Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
PowerBITestingG
Resolver I
Resolver 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 depleted like in the table below

 

Item IDCurrent QuantityDelivered DateDelivered QuantityFormula
1054516/08/202250
1054524/08/2022230
1054501/09/2022610
1054511/10/20222121-23=-2
1054524/10/20222445-24=21

 

Any ideas? thank you!

1 ACCEPTED SOLUTION
Bifinity_75
Solution Sage
Solution 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

View solution in original post

1 REPLY 1
Bifinity_75
Solution Sage
Solution 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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.