Forum Discussion
Subtotal incorrect value
- 6 years ago
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
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.