Forum Discussion
Calculate Grand Total with Conditional
Hi fpavan76,
Just add this Measure to you data:
Measure=
IF (
SUM ( Table1[A] ) + SUM ( Table1[B] )
> SUM ( Table1[C] ),
SUM ( Table1[A] ) + SUM ( Table1[B] ),
0
)
Regards,
MFelix
Hi MFelix
thanks for your help but I would obtain in line Total the effective sum of table rows..
Do you have any idea?
I've attach an example, in line Total of measure I would like see the sum of rows (1.041)
thanks in advance
Regards,
Franco
- MFelix9 years ago
Super User
Is your A + B + C columns a sum of several values or are they individual values in a table? you can add it as a column instead of a measure.
Regards,
MFelix
- fpavan769 years agoRegular Visitor
A,B and C are a measures sum of several values.
for example:
A= CALCULATE ( SUM( Table1[A1] ); FILTER ( DimDates;DimDates[Date] ) )If I add a tabel column I don't think obtain Grand Total a correct result..
thanks in advance
Franco
- v-jiascu-msft9 years ago
Microsoft Employee
Hi Franco,
We need a workaround here. In my example, we can see it works.
2Measure = IF ( HASONEVALUE ( 'Date'[Calendar Year] ) = FALSE (), SUMX ( 'Date', [Sales Amount] ), [Sales Amount] )Maybe your formula is something like this:
2Measure = IF ( HASONEVALUE ( 'Table1'[Column_in_table] ) = FALSE (), SUMX ( 'Table1', [Measure] ), [Measure] )Best Regards!
Dale