Forum Discussion
DAX for FIFO quantities
- 4 years ago
Hi egle_p
Somewhere in my head, looking at the data you provided, I thought you were going for LIFO, despite you clearly saying FIFO. My apologies... 😕This is what you were after...
egle_p I've had a monster bad week at work. I apologize for not looking at this...will try to do so tomorrow 🙂
littlemojopuppy Thank you for remembering 🙂
I've figured most of it out - got too stuck on the filtered tables before. But one issue remains - rows with same arrival date need to be ordered by some other column as well (can't group them in the real data). Best would be to start from smallest quantity. I've given it a try and will continue to search in the original shared file.
- littlemojopuppy4 years agoCommunity Champion
Hi egle_p
Sorry for the delay with this...I had a monster bad week at work. 😞
I took your table and refactored it into a data model based around inventory transactions. Here is a solution that doesn't involve calculated columns. Overall, I think it's much simpler than what you had.
Hope this helps!
- egle_p4 years agoFrequent Visitor
Thank you so much for making the effort!
In this solution the sold quantities are not reducing the oldest stock first. In your posted example all of the stock from August should have been used up.
If I switch InventoryAcquired sign to <=MIN, all other SKU examples are fixed except for XYZ with its multiple stock dimensions. Not sure what to make of this..
If you have a spare moment at some point, I'd very much appreciate it if you could doublecheck.
- littlemojopuppy4 years agoCommunity Champion
Hi egle_p
Somewhere in my head, looking at the data you provided, I thought you were going for LIFO, despite you clearly saying FIFO. My apologies... 😕This is what you were after...