Forum Discussion
Pogi_Shane
1 year agoNew 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...
- Anonymous1 year ago
Hi, Pogi_Shane
Thanks for Kedar_Pande's reply. You can try this dax to achieve your need.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 _ACCUMULATEDBest Regards,
Yang
Community Support TeamIf 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
1 year agoCorrected 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