Forum Discussion
How to have Initial Inventory (Earliest Date Values)+Production-Sales=Remaining Inv. (Matrix Table)
Hello,
How would I go about having a dax measure, giving me:
Initial Inventory, based on the earliest date found in the date column;
+ (Sum of Production)
- Sum of Sales
= Remaining inventory.
Here's a snapshot of the goal:
Here's a snapshot of the way it is right now:
Any help is appreciated!
Antonio
7 Replies
- amitchandak
Super User
pa2021 , Try a measure like
calculate(sum(Table[intial Inventory]), filter(Table, Table[Date] = calculate(min(Table[date]), allexcept(Table, Table[product]))))
- Cumm Sales = CALCULATE(SUM(Table[Production Qty]),filter(allselected(Table),Table[Date] <=max(Table[Date])))
+ Cumm Sales = CALCULATE(SUM(Table[Sales Qty]),filter(allselected(Table),Table[Date] <=max(Sales[Date])))- pa2021Frequent Visitor
Hello amitchandak !
For some reason, I'm getting the error below:- amitchandak
Super User
pa2021 , my mistake, try like
calculate(sum(Table[intial Inventory]), filter(Table, Table[Date] = calculate(min(Table[date]), allexcept(Table, Table[product]))))
- CALCULATE(SUM(Table[Production Qty]),filter(allselected(Table),Table[Date] <=max(Table[Date])))
+ CALCULATE(SUM(Table[Sales Qty]),filter(allselected(Table),Table[Date] <=max(Sales[Date])))