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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
umapatil10
New Member

Calculating left over stock from previous month

I have Data something like below 

 25-May25-Jun25-Jul25-Aug25-Sep
Supply40    
Demad-10-11-12-15-20

I want to calculate Supply for next month, where it is Supply-Demad from previous month.

 25-May25-Jun25-Jul25-Aug25-Sep
Supply4030   
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-May25-Jun25-Jul25-Aug25-Sep
Supply4030197-8
Demad-10-11-12-15-20

 

@Greg_Deckler @Ritaf1983 @danextian @Akash_Varuna 

1 ACCEPTED SOLUTION
maruthisp
Super User
Super User

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




View solution in original post

4 REPLIES 4
v-menakakota
Community Support
Community Support

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  

maruthisp
Super User
Super User

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




KonradZawel
Helper I
Helper I

 

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.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors