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
tutuk28
Helper IV
Helper IV

Accumulate the values from lowest to highest

Hello, everybody!

I have the following problem, I need to accumulate value from lowest to highest taking into account 2 columns (Route and Supplier).

I need to get the "Accumulative" column:

 

RouteSupplierValueAccumulative
1A22
1C57
1B613
2C11
2A56
2B612

 

Is there a way to do this?

Thanks!

Regards!

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @tutuk28 ,

You can create two calculated columns as below to achieve it:

Rank = CALCULATE(COUNTROWS('Accumulate'),ALLEXCEPT('Accumulate','Accumulate'[Route]),'Accumulate'[Value] < EARLIER('Accumulate'[Value]))+1
Accumulative = CALCULATE(SUM('Accumulate'[Value]),FILTER(ALL('Accumulate'),'Accumulate'[Route]=EARLIER('Accumulate'[Route])&&'Accumulate'[Rank]<= EARLIER('Accumulate'[Rank])))

Accumulate the values.JPG

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @tutuk28 ,

You can create two calculated columns as below to achieve it:

Rank = CALCULATE(COUNTROWS('Accumulate'),ALLEXCEPT('Accumulate','Accumulate'[Route]),'Accumulate'[Value] < EARLIER('Accumulate'[Value]))+1
Accumulative = CALCULATE(SUM('Accumulate'[Value]),FILTER(ALL('Accumulate'),'Accumulate'[Route]=EARLIER('Accumulate'[Route])&&'Accumulate'[Rank]<= EARLIER('Accumulate'[Rank])))

Accumulate the values.JPG

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This solution needed.

Thanks  @v-yiruan-msft  !

Pragati11
Super User
Super User

Hi @tutuk28 ,

 

There is an existing thread for the similar scenario. Check this:

https://community.powerbi.com/t5/Desktop/Summarize-and-Rank-by-multiple-columns-and-rows/td-p/330108

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.