Forum Discussion
nardcox
3 years agoFrequent Visitor
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 d...
PaulDBrown
3 years agoCommunity Champion
See if this is what you need:
A temporary measure to get the calculation
Expiry Risk Temp =
VAR _Days = DATEDIFF(TODAY(),MAX(Stock_exp[Date]), DAY)
VAR _Sales = _Days * 2.43
VAR _Qty = SUM(Stock_exp[Stock]) - _Sales
RETURN
IF(_Qty <0, ABS(_Qty))
And to get the total
Expiry Risk Total =
SUMX(Stock_exp, [Expiry Risk Temp])
Sample PBIX file attached
nardcox
3 years agoFrequent Visitor
PaulDBrown, unfortunately that doesn't work.
For example the first line. I have 119 pcs, 105 days left. 105 days left * 2.43 = 255 sales possible. I only have 119 pcs. Meaning I can sell all of them before they expire, meaning the risk will be 0 since I can sell all of them.
The risk you calculated is actually higher than the stock I have, which isn't possible because I can't scrap more items than I actually have.