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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a requirement to create an inventory forecast by month table where:
InventoryClosing = InventoryOpening + Re-supply - Demand
However, when the demand is higher than InventoryOpening + Re-supply, total inventory should become zero and not negative. current month's InventoryOpening = last month's InventoryClosing (InventoryOpening at the start of the period is given)
My Data Table:
My Result columns should look like:
Trying to calculate InventoryClosing using InventoryOpening results a circular reference.
Could not use the cumulating demand and re-supply due to negative inventory values.
Any reccomondation/s would be much appreciated.
Solved! Go to Solution.
Hi @Anonymous ,
like this?
If this can meet your needs, try this measure:
closing inventory = var _value= SUMX(FILTER(ALL('Table'),'Table'[Index]<=MAX('Table'[Index])),'Table'[re-supplied]-'Table'[sales demand])+3500
return if(_value<0,0,_value)
and this is my pbix file for you to refer.
Best regards,
Community Support Team Selina zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
like this?
If this can meet your needs, try this measure:
closing inventory = var _value= SUMX(FILTER(ALL('Table'),'Table'[Index]<=MAX('Table'[Index])),'Table'[re-supplied]-'Table'[sales demand])+3500
return if(_value<0,0,_value)
and this is my pbix file for you to refer.
Best regards,
Community Support Team Selina zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 99 | |
| 76 | |
| 56 | |
| 51 | |
| 46 |