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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX expression for subtracting 3 measures

Hi team

I'm hoping I can have some help. I know this achievable as I've done this before but unfortunately an IT mishap has led to me losing my data.

Here is an example of data:

MandiR_0-1620227842746.png

I want to achieve the formula of Owes- Repaid - Written off to give me the amount remaining. The issue is that the repaid and written off values are measures and everything I try using SUMX or CALCULATE results in a circular dependency. I have literally spent all day trying to find the answer on here and I can't find it- I know I did a nested calculate/SUMX formula or something before. Everything I've found so far on the formula is coming up with the circular dependency.

 

Please help! It's driving me crazy.

 

Thanks in advance 🙂

 

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , as the last two are measures , this should work

Sum(Table[Owes]) - [Repaid] - [Written off]

 

If not

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Good evening! Thank you for trying to help. Sadly that one gives me a Sum function only accepts column reference as an argument. So I amended to:

 

=SUM('Table'[Owes])-SUM('Table'[repaid] etc and that worked but gave me the grand total against every row.

 

What I really need is the SUMX function to give me the total per row instead!

 

=SUMX('Table'[Owes])-('Table'[repaid]

Gives me the same as above

 

I tried using the filter to filter by Number to give me just the figure per employee, and I tried the calculate function to filter but still to no avail.

 

Sadly I can't share the data due to confidentiality, but any suggestions would be very, very well received!!! 🙂

 

Anonymous
Not applicable

Right, I've managed to figure it out and I want to share just in case other people have the same issue.

 

The issue was my written off value was pulling a value based on the 'owes' amount. I scrapped this and started again with a boolean value instead, 1 for written off and 0 for not written off. This way I'm not causing a circular issue.

 

I then used this expression:

 

CALCULATE(SUMX('Table', 'Table'[Owes]-'Table'[Repaid]),'Table'[Written Off]=0)

 

Which then gave me the total remaining figure per employee.

Thank God.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.