This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
I need a sub total in each group, but why the calculation incorrect. I use matrix table for this report and already set sub total
My DAX calculation is:
Any help would be appreciated. Thanks!
Solved! Go to Solution.
@Anonymous , when every you use if and switch then it needs a row context of table. and that context is missing at sub total and total level. If user filter clause then we remove that data and sum it up to we will get the correct subtotal.
If possible use filter in place of filter data in Switch, use a switch to change calculations
In the above case force a row conetxt from the lowest level like this example
sumx(summarize(Table,Table[class], table[country],"_1",[Budget]),[_1])
Here data is first groped at Table[class], table[country] level then used. You can have more or less level as per need
Hi @Anonymous ,
I agree with @amitchandak. You could use the formula that he suggests to have a try. If you can't implement or you have other questions, please share some sample data and your expected output. We will understand clearly about your situation.
@Anonymous , when every you use if and switch then it needs a row context of table. and that context is missing at sub total and total level. If user filter clause then we remove that data and sum it up to we will get the correct subtotal.
If possible use filter in place of filter data in Switch, use a switch to change calculations
In the above case force a row conetxt from the lowest level like this example
sumx(summarize(Table,Table[class], table[country],"_1",[Budget]),[_1])
Here data is first groped at Table[class], table[country] level then used. You can have more or less level as per need
Hi All @amitchandak @v-xuding-msft
Thank you for your responded.
Idea provided by @amitchandak worked, I changes the rule of filter in group first to get value correctly and calculate it.
Thank you very much.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 30 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 45 | |
| 33 | |
| 24 | |
| 23 |