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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

subtract refunds from purchases

Hi, I need to create a formula that will help me deduct refund amounts from the purchases.  All the transaction amounts are in one column, there is a refund attribute that is tracked in another column.  How do I get Power BI to deduct the refunds so that we can get an accurate net income for the day?  I have the date filters all built, just can figure out how to do the math to deduct the refund.

 

This is adding them

refund.PNG

 

These are the columns

columns.PNG

 

2 ACCEPTED SOLUTIONS

There are a few ways. Probabaly easiest is to write a measure (or two)

total raw amount= sum(apprasialaccount(amount)

total sales =calculate([total raw amount],appraisalaccount[refund]=“False”)

total refunds = -calculate([total raw amount],appraisalaccount[refund]=“True”)

total amount = [total sales]+[total refunds]

 

note the negative sign in front of refunds



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

Anonymous
Not applicable

All working now, Tanks

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

All working now, Tanks

There are a few ways. Probabaly easiest is to write a measure (or two)

total raw amount= sum(apprasialaccount(amount)

total sales =calculate([total raw amount],appraisalaccount[refund]=“False”)

total refunds = -calculate([total raw amount],appraisalaccount[refund]=“True”)

total amount = [total sales]+[total refunds]

 

note the negative sign in front of refunds



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Hi, I have a similar problem, only I need to produce counts of transactions. With my data the refunds balance out, but the original transaction and the refund will be counted as two transactions - I want to count them as 0 transactions. How would I get around this?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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