Forum Discussion
aramirez2
6 years agoHelper I
Predict Future Inventary
Hello. I am creating Inventory Table mixing real data for the past days and predicted data for the future days. I have these 3 tables: https://docs.google.com/spreadsheets/d/1NHSx1a4oN7X3hYK3...
- 6 years ago
v-lili6-msft Sorry I forgot to open the spreadsheet. However I have already found the solution
Sf = VAR Sf = LOOKUPVALUE(PASTINVENTORY[Sf], PASTINVENTORY[Date], MAX(PASTINVENTORY[Date]), PASTINVENTORY[Product], inventory[productId]) var curdate = inventory[date] var lastdate1 = MAX(PASTINVENTORY[Date]) var io = CALCULATE(SUM(inventory[income])-SUM(inventory[outcome]),FILTER(ALL(inventory),AND(inventory[date] <= curdate,inventory[date] >= lastdate1))) var a = IF(inventory[date]<TODAY(), LOOKUPVALUE(PASTINVENTORY[Sf], PASTINVENTORY[Date], inventory[date], PASTINVENTORY[Product], inventory[productId]), Sf+io) RETURN a
Greg_Deckler
6 years agoCommunity Champion
aramirez2 - Perhaps have a look at Days of Supply - https://community.powerbi.com/t5/Quick-Measures-Gallery/Days-of-Supply/m-p/635656#M318
- aramirez26 years agoHelper I
Thanks Greg_Deckler for your answer. It is a great exercise even though it is not very related to my issue.