Forum Discussion
Calculate Grand Total with Conditional
Hi MFelix
I've try use your suggestion but I don't know because it work incorrectly.
In attachment you should see the Measure to calculate A,B and C (i.e. Measure A),
Measure with condition,
measure without condition.
If you observe the misure with condition the Grand Total is 28, not 30..
Thanks in advance.
Franco
Hi fpavan76,
Did you try to put the Measure with condition as a result of a column, as I said before, because when you use it in the measure the context is avalueted.
Mfelix
- v-jiascu-msft9 years agoMicrosoft Employee
Hi fpavan76,
Please allow me to make some explanation. The picture below is from your post.
I guess the first column is "DimDate"[Date] in your visual. So, we test it if it's a row or the grand total. Because a row only has one "DimDate"[Date] while the grand total has all the "DimDate"[Date]. If the first parameter of "IF" is true, we just run [Measure A]. Or, we run [Measure A] over all the table and sum it. Please have a try.
Could you please post your formula if failed?
2Measure = IF ( HASONEVALUE ( 'DimDate'[Date] ) = TRUE (),
[Measure A] SUMX ( 'Table', [Measure A] ), )Best Regards!
Dale