Forum Discussion
A seemingly complex task...
I created a "Pallet Ranking" by going into query editor, and sorting first by SKU, then LOT, then FIFO date, and adding an Index column.
Seems to work. So how would I create the running total measure? I tried the following but it did not work:
- CoreyP6 years agoSolution Sage
That doesn't seem to be working. Just returns 1 for every value. Do we have to take item_no into context somehow?
- kentyler6 years agoSolution Sage
If you just return the current index, does it show the correct number ?
- CoreyP6 years agoSolution Sage
This is what it returns:
Using this measure:
Cumulative Qty =VAR cur_index = MAX('Inventory'[Pallet Rank])RETURNCALCULATE (SUM( 'Inventory'[ONHAND_QTY] ),FILTER (ALL('Inventory'[Pallet Rank]),'AIRMInventory'[Pallet Rank] <= cur_index )) - kentyler6 years agoSolution Sage
Try moving the ALL() outside the FILTER()
- kentyler6 years agoSolution Sage
and you can short cut the filter statement
FILTER (ALL('Inventory'[Pallet Rank]),'AIRMInventory'[Pallet Rank] <= cur_index ))by just writing, 'AIRMInventory'[Pallet Rank] <= cur_indexas an argument to CALCULATECALCULATE will turn it into a filter automatically - CoreyP6 years agoSolution Sage
Still not making any progress...pretty sure this link describes something very similar for what I'm trying to do, just can't get it to work in my context.
https://forum.enterprisedna.co/t/running-totals-on-a-measure-with-no-index-or-date-column/147/7
- kentyler6 years agoSolution Sage
I know the feeling. It can't seem impossible. There is just some little detail we have to find.
If you just write the Rankx measure (following his example) in a measure and put it in a table, what does it return ?