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

accounting math question

So I have a database that just keeps all transaction amounts in one column, regardless of charge or refund.  There is a seperate column that tracks if refund (true/flase)

I need to calculate the net amount charged.  how do i create a colum that will subtract the amounts if a refund is true?

 

I have 9 accounting item type, so I need to add them all and make sure that if the refund attribute is true, then I subtract that amount.

 

Im Trying to call it balance due.

 

Capture.PNG

 

 

1 ACCEPTED SOLUTION

There is limitation in DAX when you direct query because of performance.

 

Goto option and Settings -> Options -> Direct Query and check "Allow unrestricated measures in Direct Query mode" and see if this works for you. 

 

There are lot of articles what are the restriction in direct query mode, please check those out.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
MFelix
Super User
Super User

Hi @ Dave_C,

Try something like this

Balance due =
CALCULATE ( SUM ( Table[Amoumt] ), MAX ( Table[Refund] ) <> TRUE () )
- CALCULATE ( SUM ( Table[Amoumt] ), MAX ( Table[Refund] ) = TRUE ())

Assiming your table is a true false field.

Not on computer but should work.

Regaeds,
Mfelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

I have gotten the math to work finally, problem is I have data in two different tables to use in the equation.  Im getting an error when I try and use the total fee which is in table A, and need to subtract total charged which is in table B.  Says I cant do this in direct querry

Anonymous
Not applicable

I keep getting these stupid mesages

Column = RELATED(vwAppraisalComposite[TotalFee])-(AppraisalAccountingItem[Net Total])

Function 'CALCULATE' is not allowed as part of calculated column DAX expressions on DirectQuery models.

There is limitation in DAX when you direct query because of performance.

 

Goto option and Settings -> Options -> Direct Query and check "Allow unrestricated measures in Direct Query mode" and see if this works for you. 

 

There are lot of articles what are the restriction in direct query mode, please check those out.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

FYI, I had already set this option up and it did not work.  I had to turn it off and then back on 2 more times in order to get it to work.  

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.