Forum Discussion
PowerBITestingG
3 years agoResolver I
Inventory DAX First in First out
So I basically want to compute a formula that calculates the Current Quantity - Delivered quantity of the MAX(Delivered date) and then do it again for the next one until the Current Quantity gets d...
- 3 years ago
Hi PowerBITestingG , try this calculate column: Name of column:"Table_"
Formula = var cumulative=CALCULATE(SUM(Table_[Delivered Quantity]), FILTER(ALLEXCEPT(Table_,Table_[Item ID]), Table_[Delivered Date] >= EARLIER ( Table_[Delivered Date] ))) return if(Table_[Current Quantity]-cumulative<0,0, Table_[Current Quantity]-cumulative )Best regards
Bifinity_75
3 years agoSolution Sage
Hi PowerBITestingG , try this calculate column: Name of column:"Table_"
Formula = var cumulative=CALCULATE(SUM(Table_[Delivered Quantity]),
FILTER(ALLEXCEPT(Table_,Table_[Item ID]),
Table_[Delivered Date] >= EARLIER ( Table_[Delivered Date] )))
return
if(Table_[Current Quantity]-cumulative<0,0,
Table_[Current Quantity]-cumulative
)Best regards