Forum Discussion
Calculate Grand Total with Conditional
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
Hi MFelix
I've tried your proposal but it result a non-correct value.
Do you think it depend to the data model?
- 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