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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DaveCor
Helper I
Helper I

How to determine the effect on a total figure from a single product by excluding it

Hi folks, I am trying to determine the effect a single item has on the overall totals if I excluded it from last years total and this years total and divided those figures into each other. 

 

I have 3 tables

 

The first is a returns table

 

DateReturn IDProduct Name
01-Oct-201912358Apple
05-Dec-201926959Grape
28-Jan-202032659Banana
09-Jun-202065323Grape

 

The second is a Sales table

 

DateProduct NameSale Qty
01-Sep-2019Apple1
10-Oct-2019Grape1
10-Mar-2020Apple3
27-May-2020Grape4
06-Jul-2020Banana2

 

The last is a Calendar table 

 

Returns measure is - 

Total Returns = DISTINCTCOUNT('returns_table'[Return ID])
 
Sales measure is - 
Total Sales = Sum('Sales_table'[Sale Qty])
 
My "return rate", which is returns per million, is calculated using -
Return Rate = 1000000 * DISTINCTCOUNT(returns_table[Return ID])/SUM(Sales_table[Sale Qty])
 
I can calculate last year & this years Return rates using the following 2 measures
Return Rate YTD = 1000000* DIVIDE(
TOTALYTD(COUNT(returns_table[Return ID]),'Calendar'[Date]),TOTALYTD(SUM(Sales_table[Sale Qty]),'Calendar'[Date]) )
 
Return Rate YTD LY = CALCULATE([Return Rate],PREVIOUSYEAR('Calendar'[Date]))
 
I can then determine a ratio as 
Ratio = [Return Rate YTD]/[Return Rate YTD LY]
 
I end up with something like this
 
Product NameTotal ReturnsTotal SaleReturn RateReturn Rate YTDReturn Rate LYAdjusted Return Rate YTDAdjusted Return Rate YTD LYAdjusted Ratio
AppleXXXXX???
Grapexxxxx???
Bananaxxxxx???
 
Here is where I am getting stuck. The "Adjusted" Return Rates show the overall total Return Rate if the returns and sales for a given product was removed from the overall total. As an example, the Adjusted Return Rate YTD figure for Apple would be something like this:
(Total Returns for this year - Apple returns)/(Total sales for this year - Apple Sales)*1000000
 
I can't figure this one out though, some help would be appreciated
3 REPLIES 3
DaveCor
Helper I
Helper I

Hi @amitchandak  I was looking over your suggestion again and I played with it a bit to try get it to work but I'm still having no luck getting it to return a value

 

This was the only attempt of mine that didn't throw up errors but still doesn't return any values

Adjusted Return Rate YTD = 1000000 * DIVIDE(
(calculate([Total Returns],datesytd('Calendar'[Date]), all(returns_table)) - calculate([Total Returns],datesytd('Calendar'[Date]))),
(calculate([Total Sales],datesytd('Calendar'[Date]), all(Sales_table)) - calculate([Total Sales],datesytd('Calendar'[Date])))
)

 

Really hoping someone can figure this one out as, I'm sad to say, this has me beat  

amitchandak
Super User
Super User

@DaveCor , Try like


divide(
calculate([Total Returns],datesytd('Calendar'[Date]), all(returns_table)) - calculate([Total Returns],datesytd('Calendar'[Date])),
calculate([Total Sales ],datesytd('Calendar'[Date]), all(Sales_table)) - calculate([Total Sales ],datesytd('Calendar'[Date]))
)

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

Hi @amitchandak , thank you, I appreciate you taking the time to look at this.

 

I tried your suggestion but I am getting no values when I add it to my table, just a blank column. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.