Forum Discussion
Inventory and Stock balance calculation
- Anonymous8 months ago
Hi DineshJadhav ,
Thank you for following up.
I’ve attached the PBIX file, which contains the full working setup, including the sample data model, relationships, base measures, and the final running stock balance calculation.This approach anchors the calculation to the opening inventory of the first visible month and then accumulates the net movement (Supply minus Demand) up to the current month. By adding this cumulative movement to the opening inventory, the balance rolls forward correctly each month without referencing the previous month’s result directly.
Please find the attached .pbix file below.
- 7 months ago
Hi DineshJadhav please try this
Stock Balance by SKU =VAR CurrentMonth =MAX ( 'Date Table'[Month Index] )
VAR FirstMonth =CALCULATE (MIN ( 'Date Table'[Month Index] ),ALLSELECTED ( 'Date Table'[Month Index] ))
RETURNSUMX (VALUES ( SKU[SKU Code] ),
VAR OpeningInventory =CALCULATE (SUM ( Inv[Inventory On Hand] ),'Date Table'[Month Index] = FirstMonth)
VAR MovementToDate =CALCULATE ([Net Movement],FILTER (ALL ( 'Date Table'[Month Index] ),'Date Table'[Month Index] >= FirstMonth&& 'Date Table'[Month Index] <= CurrentMonth))
RETURNOpeningInventory + MovementToDate)
Yes, i can access now, thank you.
Will review and get back shortly.
Hi DineshJadhav please try this
- DineshJadhav7 months agoFrequent Visitor
Hi techies
Thank you for you response.
I am still facing the same issue Stock balance is still not carrying forward to next month as opening inventory.
Could you please share the file so that I can check how you applied this logic?- techies7 months ago
Super User
- DineshJadhav7 months agoFrequent Visitor
Hi techies ,
Thank you for the file
Currently DAX is calculating correct stock balance only for first month. but for Mar 2026 Stock balance should be
Stock balance from Feb 2026 + Supply Mar 2026 - Demand Mar 2026
4,925,741+598,916-527,775 = 4,996,882 currently it is just showing Net movement as stock balance for Mar 2026. It is not considering as last months stock balance and carry it forward to next month