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
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))))

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))))

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.