Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I hope that there's someone over here that can help me.
I have a dashboard with some visuals and a filter on it.
In one filter I show the result of the sum for the max year selected. If there is not a year selected, then it wil take the last year of the whole dataset.
This works without any problem:
Sum(Aggr(Sum({<[Zitting_DeclaratieStatus]={"1","2"}, Jaar = {"$(=Max(Jaar))"}>}Distinct Zitting_ToegepastTarief), Zitting_AgendaId))
The problem is when I want to show the some sum, but then for the year before the selection. When I don't select a year from the filter, it does work.
It does not work when one year is selected. I tried a lot, but it seems that the filter on the dashboard filters the whole dataset for the whole page.
This is mij code:
Sum(Aggr(Sum({<[Zitting_DeclaratieStatus]={"1","2"}, Jaar = {"$(=Max(Jaar)-1)"}>}Distinct Zitting_ToegepastTarief), Zitting_AgendaId))
This is a screenprint of an exemple of visuals and the filter.
I found my answer:
Sum({$<Jaar=>}{<Jaar={$(=Max(Jaar)-1)}>} Aggr( SUM( {<Jaar={$(=Max(Jaar)-1)}>} ${<[Zitting_DeclaratieStatus]={"1","2"}>} Distinct Zitting_ToegepastTarief), Zitting_AgendaId))
I can't explean why this works, but I have tested it several times and it does.
Try this:
Sum(Aggr(Sum({1<[Zitting_DeclaratieStatus]={"1","2"}, Jaar = {"$(=Max(Jaar)-1)"}>}Distinct Zitting_ToegepastTarief), Zitting_AgendaId))
Thank you for your reply, but is doesn't work.
I think the problem is with the filter thats on the page. This selects the 'Jaar' and makes that the dataset has only the selected 'Jaar' values in it. Now I want to calculate with values of 'Jaar'- 1.
It look those values are not in the dataset. Is it possible to exclude this filter visual from an different visual?
Maybe this screenshot makes it more clear what I want:
The user can choose 1 or more years in the filter pane.
At the top left, it must shown the sum of all 'Zitting_ToegepastTarief' of all selected filter values.
At the top right, it must show the sum of 'Zitting_ToegepastTarief' of the latest year selected (=max year).
The two at the top doe what I want, because that works with the filter pane.
At the bottum right, I want to show the sum of all 'Zitting_ToegepastTarief' of the previus year to the max jaar selected. It shows the correct value when I also select 2021 in this case. But when that year is not selected, it just shows '0'.
Is there any way to bypass the filter pane on my sheet for the lower right visual?
Check this value in KPI box after applying filter if it is giving you required result.
{"$(=Max(Jaar)-1)"}
I found my answer:
Sum({$<Jaar=>}{<Jaar={$(=Max(Jaar)-1)}>} Aggr( SUM( {<Jaar={$(=Max(Jaar)-1)}>} ${<[Zitting_DeclaratieStatus]={"1","2"}>} Distinct Zitting_ToegepastTarief), Zitting_AgendaId))
I can't explean why this works, but I have tested it several times and it does.