Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Subtracting two measures

Hello everyone.

I have a simple question that keeps haunting me. I have 2 columns with Liablities and Receivables and I created formulas to sum it and then subtract.

 

Liablities Measure = SUMX(Table, Table[Liablities])

Receivables Measure = SUMX(Table, Table[Receivables])

 

What I want to do is subtract two columns for every month in a matrix.

I know the proper measure will be:

Result = Receivables Measure - Liablities Measure

 

But the question is: why formula:

SUMX(Table, Receivables Measure - Liablities Measure) outputs different results for certain motnhs than formula above?How does it work exactly?

 

Also the formula

CALCULATE(Receivables Measure - Liablities Measure)

outputs proper results too. How does it work exactly? How can I know if I'm using the proper formula in advanced calculations and results are proper?

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Anonymous - Tough to say with information provided, but in general, simpler is better. I would stick with 

Result = Receivables Measure - Liablities Measure

 

Unless there is some reason not to, like a measures total problem. 
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

I don't think your SUMX is a good idea there and your CALCULATE is useless because you are not switching context. So, it does 100% nothing.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.