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
abristow
Frequent Visitor

Calculating incremental items sold v PY

Hello,

 

I'm trying to calculate two similar (but different) metrics based on my sales data and need help with both, please.

 

1. [Incremental SKU] = a new item sold into a customer that has purchased other products in the past (i.e. total historical vol > 0)

2. [New SKU] = an item sold into a customer that has never purchased anything in the past (i.e. total historical vol =0)

 

In this case, the "past" is constrained to Q4 of prior year. 

 

This a super simple example of what I'm looking for in results:

 

CustomerNumDateSKUVolIncremental SKUNew SKU
10111/1/2019Chocolate3  
10111/5/2019Vanilla5  
1091/10/2020Chocolate1 1
1091/10/2020Vanilla1 1
1011/12/2020Chocolate2  
1011/12/2020Banana11 

 

Thanks so much!

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @abristow ,
 
Once you have solved the problem of the new customer, you can proceed to deal with the problem of repurchasing other products.
You can refer to this pbix.
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @abristow ,
 
Once you have solved the problem of the new customer, you can proceed to deal with the problem of repurchasing other products.
You can refer to this pbix.
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the help, @V-lianl-msft

One follow-up question: when I go to put this into my existing model, I cannot reference my date table with 'Date'[Date] as I do in other instances. Any thoughts/insights on why that would be and how to get around it? 

amitchandak
Super User
Super User

Please Try

Incremental SKU Calc = if(ISBLANK(COUNTX(FILTER(Sheet1,Sheet1[CustomerNum]=EARLIER(Sheet1[CustomerNum]) && Sheet1[SKU]=EARLIER(Sheet1[SKU]) && Sheet1[Date]<EARLIER(Sheet1[Date])),Sheet1[Date])) && [New SKU Calc] <>1,1,BLANK())
New SKU Calc New SKU Calc = if(ISBLANK( COUNTX(FILTER(Sheet1,Sheet1[CustomerNum]=EARLIER(Sheet1[CustomerNum]) && Sheet1[Date]<EARLIER(Sheet1[Date])),Sheet1[Date])),1,BLANK())

Please find the pbix :https://www.dropbox.com/s/f56p3zokducbvno/newSKU.pbix?dl=0

 

You will see a small difference because in this subset 101 is also new once and 101, vanilla is incremental SKU.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

 

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.