Hi,
I’m trying to have a bar chart for equity movement by year.
for example, the equity movement 2023 equity - 2022 equity.
I created calculated filed for the equity movement like this:
// CY
(
ifelse(
{year} = extract('YYYY', ${DateIn})
AND Date = ${DateIn}
AND in({Category}, ["EQUITY"]),
{amount},
0
)
)
-
// PY
(
ifelse(
{year} = extract('YYYY', ${DateIn}) - 1
AND in({Category}, ["EQUITY","PROFIT & LOSS ACCOUNT"]),
{amount},
0
)
)
The calculated field is giving the expected result when presented in a pivot table, without having the year as row or column.
Now, the problem when I add the year in the visual, pivot table or bar chart or any, the calculation will give a wrong result, because having the year will give PY as 0 in 2023 and CY will give 0 in 2022.
I tried creating a calculated field for each year, and list them in a table, again, once I add the year as row, it will effect the ifelse.
So, what I need is to sum values from different years and have them listed for each year.
Do you have any solution for that?