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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @mahsan_ojaghian ,

According to your description, I create a sample below.

vkalyjmsft_0-1651545822856.png

The Sum column is the result of ordinary accumulation. You say " resets when sum of values is negative and starts

with the positive value when meets a negative one." So, in my sample, for the value -6, -5, -3 in the Sum column, as it's negtive, is your expected result -20, 1, 2 remaining the same with Column1? 

For my sample, could you please show the final expected result?

 

Best Regards,
Community Support Team _ kalyj

 

Anonymous
Not applicable

Hello @v-yanjiang-msft , I have this exact problem and your solution should probably fit what I need with a little tweak.

When the value is negative, I need the next one to restart with positive.

 

Would you be able to help me? Here's the example I have and the expected result.

 

guillaume_boism_0-1682952589374.png

 

 

Thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors