Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |