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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Pogi_Shane
New Member

Future Inventory based on Current Inventory, Forecasted Sales and Future POs

been struggling to come up with a measure that calculates the running balance of inventory. Below is a table with the Column 'What i expect" and what i am trying to solve for. it basically takes "sum of on hand" +" Sum of remaining open" - "Sum of Sum of total units" = "What i expect" for December. January then takes the ending balance of December and adds "sum of Remaining Open" - "Sum of Sum of total units" = What i expect.

 

YearMonthSum of On HandSum of Remaining OpenSum of SUM of Total UnitsWhat I Expect
2024December                  194,212                                         73,788             120,424
2025January                                         50,000                                        68,679             101,745
2025February                                         25,000                                        81,021               45,724
2025March                                         80,000                                        84,099               41,625
2025April                                         50,000                                        91,693                     (68)
2025May                                         25,000                                     144,007           (119,075)
2025June                                          96,901           (215,976)
2025July                                       103,536           (319,512)
2025August                                       108,225           (427,737)
2025September                                       110,633           (538,370)
2025October                                       104,483           (642,853)
2025November                                       190,708           (833,561)

 

I created this DAX measure but its not getting the previous months ending total to then be the begining balance of the formula

 

Projected Inventory = SUMX( Netsuite_Inventory, Netsuite_Inventory[On Hand] ) + SUMX(Open_PO, Open_PO[Remaining Open]) - SUMX(Forecast_Info, Forecast_Info[SUM of Total Units])
 
any help would be really apprecaited! 
 
YearMonthSum of On HandSum of Remaining OpenSum of SUM of Total UnitsProjected Inventory
2024December                  194,212                                         73,788                          120,424
2025January                                         50,000                                        68,679                          (18,679)
2025February                                         25,000                                        81,021                          (56,021)
2025March                                         80,000                                        84,099                            (4,099)
2025April                                         50,000                                        91,693                          (41,693)
2025May                                         25,000                                     144,007                        (119,007)
2025June                                          96,901                          (96,901)
2025July                                       103,536                        (103,536)
2025August                                       108,225                        (108,225)
2025September                                       110,633                        (110,633)
2025October                                       104,483                        (104,483)
2025November                                       190,708                        (190,708)
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Pogi_Shane 

Thanks for @Kedar_Pande's reply. You can try this dax to achieve your need.

vyaningymsft_0-1735119227513.png

 

Add all = 
VAR _onHand =
    SELECTEDVALUE ( Netsuite_Inventory[On Hand] )
VAR _remainingOpen =
    SELECTEDVALUE ( Netsuite_Inventory[Remaining Open] )
VAR _units =
    SELECTEDVALUE ( Netsuite_Inventory[Sum of SUM of Total Units] )
RETURN
    Netsuite_Inventory[On Hand] + Netsuite_Inventory[Remaining Open] - Netsuite_Inventory[Sum of SUM of Total Units]

 

Cumulative value = 
VAR _index =
    MAX ( Netsuite_Inventory[Index] )
VAR _ACCUMULATED =
    CALCULATE (
        SUM ( Netsuite_Inventory[Add all] ),
        FILTER ( ALL ( Netsuite_Inventory ), Netsuite_Inventory[Index] <= _index )
    )
RETURN
    _ACCUMULATED

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @Pogi_Shane 

Thanks for @Kedar_Pande's reply. You can try this dax to achieve your need.

vyaningymsft_0-1735119227513.png

 

Add all = 
VAR _onHand =
    SELECTEDVALUE ( Netsuite_Inventory[On Hand] )
VAR _remainingOpen =
    SELECTEDVALUE ( Netsuite_Inventory[Remaining Open] )
VAR _units =
    SELECTEDVALUE ( Netsuite_Inventory[Sum of SUM of Total Units] )
RETURN
    Netsuite_Inventory[On Hand] + Netsuite_Inventory[Remaining Open] - Netsuite_Inventory[Sum of SUM of Total Units]

 

Cumulative value = 
VAR _index =
    MAX ( Netsuite_Inventory[Index] )
VAR _ACCUMULATED =
    CALCULATE (
        SUM ( Netsuite_Inventory[Add all] ),
        FILTER ( ALL ( Netsuite_Inventory ), Netsuite_Inventory[Index] <= _index )
    )
RETURN
    _ACCUMULATED

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Kedar_Pande
Super User
Super User

@Pogi_Shane 

Corrected DAX Measure:

Projected Inventory =
VAR CurrentMonth =
SELECTEDVALUE(Netsuite_Inventory[Month])
VAR CurrentYear =
SELECTEDVALUE(Netsuite_Inventory[Year])
VAR PriorBalance =
CALCULATE(
SUMX(Netsuite_Inventory, Netsuite_Inventory[What I Expect]),
FILTER(
ALL(Netsuite_Inventory),
Netsuite_Inventory[Year] * 12 + Netsuite_Inventory[Month] <
CurrentYear * 12 + CurrentMonth
)
)
VAR OnHand = SUM(Netsuite_Inventory[Sum of On Hand])
VAR RemainingOpen = SUM(Open_PO[Remaining Open])
VAR TotalUnits = SUM(Forecast_Info[SUM of Total Units])
RETURN
IF(
CurrentMonth = "December" && CurrentYear = 2024,
OnHand + RemainingOpen - TotalUnits,
PriorBalance + RemainingOpen - TotalUnits
)

Replace What I Expect with the actual column or calculated measure for prior months.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.