Forum Discussion
DAX Calculate Inventory Expiry Risk
I've been searching a lot but can't seem to find an answer. I'll try to keep it brief, concise and complete.
- I work in a warehouse
- We store goods on locations
- Some of these goods have an expiry date
- I want to calculate what the risk of expiring is for these items per location
Sound simple enough right, but
- We have a fix sequence of locations that this stock will be allocated, so I have to take that into account
Example data for a single item
| Sales Qty per day: | 2,43 | ||
| Sequence | Exp Date | Stock Qty | Expiry Qty (Desired output) |
| 1 | 28.02.2023 | 119 | 0 |
| 2 | 31.05.2023 | 121 | 0 |
| 3 | 31.05.2023 | 806 | 620 |
| 4 | 30.06.2023 | 42 | 0 |
| 5 | 28.02.2023 | 372 | 372 |
| 6 | 31.05.2023 | 810 | 810 |
| 7 | 28.02.2023 | 218 | 218 |
| 8 | 30.06.2023 | 928 | 898 |
I can't get the table looking properly so I've added a prntscrn below as well.
Really hoping someone can help. The closest I've gotten was this, the last qty (631) is incorrect.
Maybe the formula was just lucky getting the rest correct, haven't checked my other examples yet.
13 Replies
- v-luwang-msftCommunity Support
HI nardcox ,
Pls share your pbix file ,and remember to remove confidential data.
Best Regards
Lucien
- nardcoxFrequent Visitor
- PaulDBrownCommunity Champion
Check out this thread which seems to tackle a similar problem
https://community.powerbi.com/t5/Desktop/Calculate-Future-Date-of-Restock/td-p/2918589
- nardcoxFrequent Visitor
PaulDBrown, thanks for the link. I've read the topic but for that one you calculated a ROP (ReOrderPoint), I've been trying to understand the logic (which I don't), which makes it impossible for me to transfer that knowledge to my own case. Aside from not understanding I'm not sure if the logic in the other topic is the same as what I'm trying to do here.
- PaulDBrownCommunity Champion
Can you please go trhough the logic of the Expiry Quantity calculation?