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.
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 Name | Units | Sale Date |
Apples | 1200 | 1/5/20 |
Oranges | 400 | 1/3/20 |
Bananas | 600 | 2/15/20 |
Grapes | 500 | 2/10/20 |
Beginning of month inventory (BOM Table)
Product Name | Units | BOM Date |
Apples | 800 | 1/1/20 |
Oranges | 1000 | 1/1/20 |
Bananas | 300 | 1/1/20 |
Grapes | 3000 | 1/1/20 |
Units produced table
Product Name | Units | Production Date |
Apples | 1000 | 1/5/20 |
Oranges | 500 | 1/10/20 |
Bananas | 500 | 1/15/20 |
Grapes | 1000 | 2/5/20 |
Some help on this would be greatly appreciated! Thank you.
Solved! Go to Solution.
Hi,
You may download my PBI file from here.
Hope this helps.
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
Hi,
You may download my PBI file from here.
Hope this helps.
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.
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.
This is the screenshot from your PBIX file.
Hi,
I have resolved this issue by changing
How will the opening stock be calculated then?
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"))
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])
Best Regards,
Community Support Team _ Eason
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |