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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sagadgreat
Helper I
Helper I

Tracking sales vs. returns made in consecutive months

I have a table where there are sales vs. returns made in consecutive months anda  formula that is calculating total extended sales. 

 

If I put both months in using the positive and negative qtys (see table example), it works fine to remove or zero out the item from total sales as being returned.  If I filter to February however, I get the -revenue with no cost associated, skewing calculations for gross margin, etc.

 

My thought is for the following month, when that return occurs it should zero out the previous sale for both cost and total revenue, removing it from the equation for Gross Profit and Margin calculations.  I have tried both multiplying by the negative qty and making absolutes but just can't seem to get it to work.

 

I am a newbs newb and appreciate any guidance as this is my first post to the community:

 

Customer NameDateQty PurchasedCostTotal Revenue
ABC Company1/12/2020110100
ABC Company2/12/2020-110-100

  

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

I did not get it completely. But do you want to combine this month's sales with next month's return? you can have formula's like

 

MTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))
next MTD (complete) return =  CALCULATE(SUM(Return[Return Amount])*-1,DATESMTD(ENDOFMONTH(dateadd('Date'[Date],1,MONTH))))
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

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @sagadgreat 

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case and help the other members find it more quickly?
If not, please feel free to let me know.
 
Best Regards
Maggie
amitchandak
Super User
Super User

I did not get it completely. But do you want to combine this month's sales with next month's return? you can have formula's like

 

MTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))
next MTD (complete) return =  CALCULATE(SUM(Return[Return Amount])*-1,DATESMTD(ENDOFMONTH(dateadd('Date'[Date],1,MONTH))))
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

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.

Top Solution Authors