Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
In DAX, I am trying to subtract one measure from another , lets say A-B and I wrote a condition (If A>B, A-B, 0). I am not able to get the total of this measure.
I am trying to subtract two measures, A-B with a condition that if it is negative value then it should be 0. I am not able to get the total value
hi, @Anonymous
It is a measure totals problem. Very common.
here is a post for you to reference:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
IF not your case, Please share some data sample and the formula and expected output. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading
Best Regards,
Lin
If you want the total to work correclty then you should do a SUMX (assuming you looking for sum):
Final Measure =
SUMX (
VALUES ( Table[Dimension Used in your table] ),
VAR a = [A]
VAR b = [B]
RETURN
IF ( a > b, a - b, 0 )
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.