Forum Discussion
Calculation Group & Parameter in Column & Column Total
Hi PierreL69,
Thank you for reaching out to Microsoft Fabric Community.
Here the issue is because when a Calculation Group is combined with a field or column parameter that switches between Year/Quarter/Month.
When the matrix reaches the last level of the column hierarchy, the Total column no longer has a single time period in scope. In that situation the calculation item is evaluated in a multi-period context so it returns blank, which is why the totals disappear.
You need to update the calculation items in Tabular Editor so that they return a correct value both at the leaf level and at the total level. Please follow below steps:
- Detect whether a single time period is in scope like using ISINSCOPE( Year / Quarter / Month ). If one of them is in scope, return your normal calculation like Current, Previous, YoY, etc..
- If none of them is in scope(which is the Total column), you must manually aggregate by iterating the visible periods:
SUMX (VALUES( <The lowest grain column> ), <The shifted measure>
This makes the calculation item produce a valid value when the field parameter removes the time grain from the total column.
After updating each calculation item using this pattern, the current and previous totals will appear again exactly as expected without needing a duplicate visual or any workaround in the report.
Thanks and regards,
Anjan Kumar Chippa
Hi v-achippa
Thanks a lot for your reply,
I already tried lot of solution listed there Related Topic by @Ahmed-Elfeel but unfortunately without success.
That is why I created this topic with a simple PBIX file, so that people who know how to solve my problem can do so in this test file, and so that I can use it as a guide.
Would you be able to display the Gand total Column in the file I attached to this thread ?
(If I don't have the subtotals per column, it's not a big deal).
Thanks a lot