Forum Discussion
Choose which calculationgroup to use?
Hello,
I am interested in a way to choose which calculationgroup should I use. What does it mean? I have set of columns in regards of Current Date (3 columns like ACT, PY, YOY), MTD (ACT,PY,YOY,ESTIMATION) and YTD also with an additional column. What I try to achieve is to have some sort of slicer with Current Date MTD AND YTD values which would drag adding all those 3 columns for Current Date or 4 for MTD/YTD. And If user want, can select all 3, so the matrix got total of 11 columns, or 2 so matrix got 7 or 8 columns depending on choice
Is it something achieveable?
- Anonymous2 years ago
Hi, Pbiuserr
If you want to know more about compute groups, you can refer to the Compute groups article in SQLBI and then evaluate whether your current choice can be realized, you can click on the following link:
Using calculation groups to selectively replace measures in DAX expressions - SQLBI
Official Documentation:
Create calculation groups in Power BI (preview) - Power BI | Microsoft Learn
As you mentioned, you want to control the appearance of your set of columns in the slicer and you can use a custom matrix header. I used the following sample data:
I've created a matrix header table:
Use the following DAX expression to create a measure to switch columns:
Measure = SUMX('Fact','Fact'[sales]) Measure A = VAR _seleted = SELECTEDVALUE(Header[name]) RETURN CALCULATE(SUM('Fact'[sales]),FORMAT('Fact'[Date],"MMM")=_seleted) Measure B = DIVIDE(SUM('Fact'[sales]),10)Data = SWITCH(TRUE(), SELECTEDVALUE(Header[Indicator])="Month", SWITCH(TRUE(), SELECTEDVALUE(Header[name])="Jan",[Measure A], SELECTEDVALUE(Header[name])="Feb",[Measure A], SELECTEDVALUE(Header[name])="Mar",[Measure A] ), SELECTEDVALUE(Header[Indicator])="Other calculation", SWITCH(TRUE(), SELECTEDVALUE(Header[name])="Total",[Measure] ), SELECTEDVALUE(Header[Indicator])="Other calculation1", SWITCH(TRUE(), SELECTEDVALUE(Header[name])="Zther calculation",[Measure B] ) )
Here's what it looks like:This will display the groups selected by the user. You can refer to the related cases below:
Solved: How to show a Row Total as Row element in a matrix... - Microsoft Fabric Community
Solved: Matrix Overlapping Groups - Microsoft Fabric Community
Solved: How to add a custom measure at the end of matrix v... - Microsoft Fabric CommunityBest Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi, Pbiuserr
If you want to know more about compute groups, you can refer to the Compute groups article in SQLBI and then evaluate whether your current choice can be realized, you can click on the following link:
Using calculation groups to selectively replace measures in DAX expressions - SQLBI
Official Documentation:
Create calculation groups in Power BI (preview) - Power BI | Microsoft Learn
As you mentioned, you want to control the appearance of your set of columns in the slicer and you can use a custom matrix header. I used the following sample data:
I've created a matrix header table:
Use the following DAX expression to create a measure to switch columns:
Measure = SUMX('Fact','Fact'[sales]) Measure A = VAR _seleted = SELECTEDVALUE(Header[name]) RETURN CALCULATE(SUM('Fact'[sales]),FORMAT('Fact'[Date],"MMM")=_seleted) Measure B = DIVIDE(SUM('Fact'[sales]),10)Data = SWITCH(TRUE(), SELECTEDVALUE(Header[Indicator])="Month", SWITCH(TRUE(), SELECTEDVALUE(Header[name])="Jan",[Measure A], SELECTEDVALUE(Header[name])="Feb",[Measure A], SELECTEDVALUE(Header[name])="Mar",[Measure A] ), SELECTEDVALUE(Header[Indicator])="Other calculation", SWITCH(TRUE(), SELECTEDVALUE(Header[name])="Total",[Measure] ), SELECTEDVALUE(Header[Indicator])="Other calculation1", SWITCH(TRUE(), SELECTEDVALUE(Header[name])="Zther calculation",[Measure B] ) )
Here's what it looks like:This will display the groups selected by the user. You can refer to the related cases below:
Solved: How to show a Row Total as Row element in a matrix... - Microsoft Fabric Community
Solved: Matrix Overlapping Groups - Microsoft Fabric Community
Solved: How to add a custom measure at the end of matrix v... - Microsoft Fabric CommunityBest Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.