Forum Discussion
fpavan76
9 years agoRegular Visitor
Calculate Grand Total with Conditional
Hi to all, I need a suggest about a measure to calculate grand total with particular condition. I have 3 columns A, B and C I want insert this condition: IF A+B > C then A+B else 0 This formula ...
fpavan76
9 years agoRegular Visitor
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-msft
9 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