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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mahsan_ojaghian
Frequent Visitor

Reset cumulative sum when sum of values is negative

Hi Guys!

I want to do cumulative sum on a calculate column and

I want it resets when sum of values is negative and starts

with the positive value when meets a negative one.

I'll be happy if somebody have an idea!!!

AND it would be the best if you have a DAX formula!!!!

Thanks.

4 REPLIES 4
jirojo92
New Member

Hi, I am currently facing the same problem, and despite looking for a solution for a long time, I have not found any.

 

I need a cumulative sum, that does not go below 0. I need to control stock, and it does not make sense for me to have a negative stock, as my demand that is not fulfilled, can not be recovered later.

 

Did you manage to find a solution?

v-xiaotang
Community Support
Community Support

Hi @mahsan_ojaghian 

Thanks for reaching out to us, I find a post Solved: Running total by group with a reset - Microsoft Power BI Community

does it help?

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@mahsan_ojaghian , refer if the old solution can help

https://community.powerbi.com/t5/Desktop/Consecutive-sum-for-the-positive-and-negative-values/m-p/23...

 

If this does not help
Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks.

but it did'nt work for me.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors