Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 = SUMX(VALUES('Table'[ID]),withoutGST/1.1)
RETURN
IF(SELECTEDVALUE('Table'[GST])=0,withoutGST,withGST)
So I researched and was able to have the correct total from 'Price-GST(Correct)' mesaure.
Price-GST(correct) = SUMX(VALUES('Table'[ID]),[Price-GST(wrong)])
However, i tried to combine those 2 measures into one using VAR but couldn't get what I wanted. Is there any way I can use one measure and still get the correct total?
Solved! Go to Solution.
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]
)
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]
)
It works well! Thanks a lot.