Forum Discussion
evebarratt
4 years agoHelper I
Incorrect Total using Sum, Sumx, and IF Dax
Hi, I have below dataset and table visual. I got incorrect total from 'Price-GST(Wrong)' measure. Price-GST(wrong) =
VAR withoutGST = SUM('Table'[Price])
VAR withGST = SUM...
- 4 years ago
Hi,
Please try the below measure.
New measure: = SUMX ( ADDCOLUMNS ( VALUES ( Data[ID] ), "@condition", IF ( CALCULATE ( SELECTEDVALUE ( Data[GST] ) ) = 0, CALCULATE ( SUM ( Data[Price] ) ), CALCULATE ( SUM ( Data[Price] ) ) / 1.1 ) ), [@condition] )
Jihwan_Kim
4 years agoSuper User
Hi,
Please try the below measure.
New measure: =
SUMX (
ADDCOLUMNS (
VALUES ( Data[ID] ),
"@condition",
IF (
CALCULATE ( SELECTEDVALUE ( Data[GST] ) ) = 0,
CALCULATE ( SUM ( Data[Price] ) ),
CALCULATE ( SUM ( Data[Price] ) ) / 1.1
)
),
[@condition]
)evebarratt
4 years agoHelper I
It works well! Thanks a lot.