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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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