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

How do I calculate "Sell Through Rate" using a measure

New user here. I am trying to develop a measure that will calculate the January sell through rate by individual product using data from three different tables.

 

I have created a one to many relationship between the three tables through the product name.

 

Sell through % = [units sold in january] / ( [beginning of January inventory] + [units produced January] )

 

Here are some example tables:

 

Units Sold Table

Product NameUnitsSale Date
Apples12001/5/20
Oranges4001/3/20
Bananas6002/15/20
Grapes5002/10/20

 

Beginning of month inventory (BOM Table)

Product NameUnitsBOM Date
Apples8001/1/20
Oranges10001/1/20
Bananas3001/1/20
Grapes30001/1/20

 

Units produced table

Product NameUnitsProduction Date
Apples10001/5/20
Oranges5001/10/20
Bananas5001/15/20
Grapes10002/5/20

 

Some help on this would be greatly appreciated! Thank you.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

11 REPLIES 11
v-easonf-msft
Community Support
Community Support

Hi , @l0ganBI 

 

Could you please tell me whether your problem has been solved?
If it is,  please mark the helpful replies or your reply as Answered to close this thread?

 

Best Regards,
Community Support Team _ Eason

Answered

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,
In your PBIX file the closing balance for January month is coming -200

That is an old post.  if you need my help, share some data, describe the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

I have downloaded your PBIX file , and checked how you have calculated. 
In your Pbix file the closing is wrongly calculated or its showing the incorrect values.

Devesh790_0-1663121393364.png

This is the screenshot from your PBIX file.

Hi,
I have resolved this issue by changing 

CB = CALCULATE(SUM('BOM Inventory'[Units]),DATESYTD('Calendar'[Date],"31/12"))+CALCULATE(Production[Produced]-'Units sold'[Sold],DATESYTD('Calendar'[Date],"31/12"))

What if there is no Inventory table is present and all the calculation has to be done from production table.

How will the opening stock be calculated then?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

The data there is of 2020.  In the Closing stock measure, the function used is TODAY().  Use this measure and all will work well

Closing balance = CALCULATE(SUM('BOM Inventory'[Units]),DATESBETWEEN('Calendar'[Date],DATE(2020,1,1),DATE(2020,1,1)))+CALCULATE([Produced]-[Sold],DATESYTD('Calendar'[Date],"31/12"))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi , @Ashish_Mathur  @l0ganBI 

The solution from @Ashish_Mathur  looks helpful to you .

But the  denominator seems  to be wrong.

I think the measure should be modified as below:

Sell through rate (%) = [Sold]/([Produced]+[Opening balance])

 

92.png

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

Join all three table to date calendar. with their respective dates

 

BOM Inv = Calculate(sum(BOM[Units]), Filter(('Date'),'Date'[Date]= startofmonth('Date'[Date])))					
 
MTD Sales = CALCULATE(SUM('produced table'[Units]),DATESMTD('Date'[Date]))

MTD Sales = CALCULATE(SUM('produced table'[Units]),DATESMTD('Date'[Date]))

 

 

If you select month year in the slicer , you can use the simple sum for last 2

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

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 Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut 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.