Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have Data something like below
| 25-May | 25-Jun | 25-Jul | 25-Aug | 25-Sep | |
| Supply | 40 | ||||
| Demad | -10 | -11 | -12 | -15 | -20 |
I want to calculate Supply for next month, where it is Supply-Demad from previous month.
| 25-May | 25-Jun | 25-Jul | 25-Aug | 25-Sep | |
| Supply | 40 | 30 | |||
| Demad | -10 | -11 | -12 | -15 | -20
|
Same way i need to calculate Supply for rest of the months. please provide DAX logic for this.
I need the final o/p like below
| 25-May | 25-Jun | 25-Jul | 25-Aug | 25-Sep | |
| Supply | 40 | 30 | 19 | 7 | -8 |
| Demad | -10 | -11 | -12 | -15 | -20 |
@Greg_Deckler @Ritaf1983 @danextian @Akash_Varuna
Solved! Go to Solution.
Hi umapatil10,
I tried to implement the solution in the below attached pbix file. Please check it.
Calculating left over stock from previous month.pbix
Please let me know if you have further questions.
If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks!
Best Regards,
Maruthi
LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/
X - Maruthi Siva Prasad - (@MaruthiSP) / X
Hi @umapatil10 ,
Thanks for reaching out to the Microsoft fabric community forum.
I would also take a moment to thank @maruthisp , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Best Regards,
Menaka.
Community Support Team
Hi @umapatil10 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution so that other community members can find it easily.
Thank you.
Best Regards,
Menaka.
Community Support Team
Hi umapatil10,
I tried to implement the solution in the below attached pbix file. Please check it.
Calculating left over stock from previous month.pbix
Please let me know if you have further questions.
If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks!
Best Regards,
Maruthi
LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/
X - Maruthi Siva Prasad - (@MaruthiSP) / X
To calculate leftover stock from last month, you can create a measure that subtracts the total sales from the total stock for that period. Make sure your date filters are set correctly to isolate the previous month’s data. Using time intelligence functions in DAX can make this easier.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!