Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
formula = previous month closing stock +receipts+production-demnad
Brand | Product Code | Date | Sum of Closing Stock | Demand | Production | Receipts |
Brand A | 694193 | 01-03-2022 | 35255 | |||
Brand A | 716504 | 01-03-2022 | 26703 | |||
Brand A | 722757 | 01-03-2022 | 19308 | |||
Brand B | 728221 | 01-03-2022 | 29024 | |||
Brand B | 736682 | 01-03-2022 | 30673 | |||
Brand C | 748798 | 01-03-2022 | 39212 | |||
Brand C | 749064 | 01-03-2022 | 3240 | |||
Brand A | 694193 | 01-04-2022 | 30535 | 0 | 21780 | |
Brand A | 716504 | 01-04-2022 | 22203.25 | 15173 | 0 | |
Brand A | 722757 | 01-04-2022 | 16017.29 | 20409 | 0 | |
Brand B | 728221 | 01-04-2022 | 24531 | 17635 | 0 | |
Brand B | 736682 | 01-04-2022 | 26039.67 | 20278 | 0 | |
Brand C | 748798 | 01-04-2022 | 39211.58 | 37622 | 0 | |
Brand C | 749064 | 01-04-2022 | 1078.834 | 0 | 1045.334 | |
Brand A | 694193 | 01-05-2022 | 24891 | 0 | 20100 | |
Brand A | 716504 | 01-05-2022 | 18304 | 21621.38 | 0 | |
Brand A | 722757 | 01-05-2022 | 16072.54 | 14351.33 | 0 | |
Brand B | 728221 | 01-05-2022 | 22127.67 | 27013.33 | 0 | |
Brand B | 736682 | 01-05-2022 | 24910.67 | 24362.17 | 0 | |
Brand C | 748798 | 01-05-2022 | 37621.42 | 42036.25 | 0 | |
Brand C | 749064 | 01-05-2022 | 1082.834 | 0 | 1156.167 | |
Brand A | 694193 | 01-06-2022 | 23271 | 0 | 12580.93 | |
Brand A | 716504 | 01-06-2022 | 19663.46 | 12442.5 | 0 | |
Brand A | 722757 | 01-06-2022 | 17261.96 | 14012.17 | 0 | |
Brand B | 728221 | 01-06-2022 | 27013.83 | 10103.33 | 0 | |
Brand B | 736682 | 01-06-2022 | 24362.67 | 20547.83 | 0 | |
Brand C | 748798 | 01-06-2022 | 42037.08 | 21671.13 | 0 | |
Brand C | 749064 | 01-06-2022 | 1074.667 | 0 | 993.501 | |
Brand A | 694193 | 01-07-2022 | 12225 | 0 | 23230.1 | |
Brand A | 716504 | 01-07-2022 | 13363.79 | 10917.58 | 0 | |
Brand A | 722757 | 01-07-2022 | 17061.46 | 8524.833 | 0 | |
Brand B | 728221 | 01-07-2022 | 10103.33 | 20276 | 0 | |
Brand B | 736682 | 01-07-2022 | 20547.83 | 13400.17 | 0 | |
Brand C | 748798 | 01-07-2022 | 21671.13 | 22687.37 | 0 | |
Brand C | 749064 | 01-07-2022 | 0 | 0 | 334.833 |
Solved! Go to Solution.
Hi @tkavitha911
You can try below calculated column expression.
Closing Stock =
CALCULATE(
SUMX('Table','Table'[Sum of Closing Stock]+'Table'[Production]+'Table'[Receipts]-'Table'[Demand]),
ALLEXCEPT('Table','Table'[Brand],'Table'[Product Code]),
'Table'[Date]<=EARLIER('Table'[Date])
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Thank you for your assistance, your solution resolved my issue, and I have marked your post as the solution and added Kudos.
Hi @tkavitha911
You can try below calculated column expression.
Closing Stock =
CALCULATE(
SUMX('Table','Table'[Sum of Closing Stock]+'Table'[Production]+'Table'[Receipts]-'Table'[Demand]),
ALLEXCEPT('Table','Table'[Brand],'Table'[Product Code]),
'Table'[Date]<=EARLIER('Table'[Date])
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
I need assistance with calculating the closing stock for each month using DAX, starting from the March closing stock. Could someone please help me with this.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
9 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |