Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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 ID | Current Quantity | Delivered Date | Delivered Quantity | Formula |
| 105 | 45 | 16/08/2022 | 5 | 0 |
| 105 | 45 | 24/08/2022 | 23 | 0 |
| 105 | 45 | 01/09/2022 | 61 | 0 |
| 105 | 45 | 11/10/2022 | 21 | 21-23=-2 |
| 105 | 45 | 24/10/2022 | 24 | 45-24=21 |
Any ideas? thank you!
Solved! Go to Solution.
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
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
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 51 | |
| 36 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 77 | |
| 41 | |
| 26 | |
| 26 |