Forum Discussion
Anonymous
9 years agoNot applicable
DAX Formula: Inventory QOH in reverse
Disclaimer: I just started working with DAX and I've read and watched a ton of content but I'm still getting hung up on very simple problems. I learn faster if I can see the solutions to the problem...
Anonymous
7 years agoNot applicable
Thanks for the reply! I like the addition of an index and that may be the key. There are too many items and transactions to consider inserting a row manually.
What if we reverse the sort order so index:1 is the most recent date with the known QOH. Would this eliminate the need for a new row? I still don't know how that would look....
| Index | Item | Date/Time | Qty Change | QOH | |
| 1 | Apples | 11/13/2018 17:00 | 10 | 10 | |
| 2 | Apples | 11/13/2018 16:00 | -5 | ? | 10-10=0 |
| 3 | Apples | 11/13/2018 15:00 | -2 | ? | 0-(5)=5 |
| 4 | Apples | 11/13/2018 14:00 | -3 | ? | 5-(2)=7 |
| 5 | Apples | 11/13/2018 13:00 | -2 | ? | 7-(3)=10 |
maybe...
QOH = IF index = 1, then use QOH from Item Table,
Calculate( QOH - Qty Change, Index-1)
?? Does that make sense?
Anonymous
7 years agoNot applicable
Sorry, not entirely clear. Nothing is being inserted manually, just two calculated columns set up once and then that's all.