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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
gkarop
Regular Visitor

Opening and Closing Inventory Balance - Forecasting

Hi all,  new to the forum.

Im having trouble dealing with closing balance of inventory when the forward forecast results in negatives.

 

I have:

-current starting Inventory

-monthly sales forecast

-monthly incoming inventory

 

Im using the following

InvMovement:=[PURCHASES]-[SALES]

OPENING INV:=calculate([InvMovement],FILTER(ALL('DATE'[DATE]),'DATE'[DATE]< MAX('DATE'[DATE])))+[CURRINV]

ENDING INV:=calculate([InvMovement],FILTER(ALL('DATE'[DATE]),'DATE'[DATE]<= MAX('DATE'[DATE])))+[CURRINV]

the problem is that there cases where my Sales Team is forecasting above the available inventory for a future period.  When we are out of Stock we still want the forecast to remain, even though we cant fill the sale.

The above OPENING INV and ENDING INV calculations work when inventory is always positive, but accumulates the negatives on Out of Stocks and results in incorrect (negative) opening inventory positions.  

Id like the ENDING INV results to be 0 if it calculates as negative and ENDING INV of the following period to also be zero.

 

any suggestions?

Thanks

 

 

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

Share a simple dataset and show the expected result there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks For responding.  This is what Im getting:

 JanFebMarAprMayJunJulAugSepOctNovDec
OPENING INV1202012020-80-180-28020-80-180-280-380
FORECAST100100100100100100100100100100100100
PURCHASES0200000040000000
ENDING INV2012020-80-180-28020-80-180-280-380-480
    FUTUREFUTUREFUTUREFUTUREFUTUREFUTUREFUTUREFUTUREFUTURE

 

This is the desired result:

 JanFebMarAprMayJunJulAugSepOctNovDec
OPENING INV120201202000030020010000
FORECAST100100100100100100100100100100100100
PURCHASES0200000040000000
ENDING INV2012020000300200100000
    FUTUREFUTUREFUTUREFUTUREFUTUREFUTUREFUTUREFUTUREFUTURE

Hi,

 

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi was unable to send the PBI file but I mocked up a ppvt file for an illustration of what I want.

Link to file

Hi, unfortunately im unable to share files as per my company's privacy policies.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.