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
raionpbi
Frequent Visitor

Running Total on non ordered values

Hi,

I need a help with following scenario:

I need to present cumulative value by category and category must be ordered asc by value.

When calculating it using 

Value Cumulative = calculate(sum(Sales[value]);filter(ALLSELECTED(Sales[category]); Sales[category]<=max(Sales[category])))

it works in alphabetical order, but when trying to sort the cumulation breaks

pbirt.PNG

What is needed is 2nd table with Value Cumulative 5,9,12.

 

Basically the question is if it is there any way to calculate cumulatively when you dan't have ordered column reference like date or number. I know I could calculate ranking column and reference it in filter but it woudln't be flexible when changeing aggregation levels or filters.

 

Thanks for any help

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

hi,@raionpbi

   After my research, you can use this formula as below:

 

Measure = CALCULATE(SUM(Sales[value]),FILTER(ALL(Sales),[rank]<=MAXX(Sales,[rank])))

Result:

6.PNG

 

here is pbix, please try it.

https://www.dropbox.com/s/y78z2mozfxof0hz/Running%20Total%20on%20non%20ordered%20values.pbix?dl=0

 

Best Regards,

Lin

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi,@raionpbi

   After my research, you can use this formula as below:

 

Measure = CALCULATE(SUM(Sales[value]),FILTER(ALL(Sales),[rank]<=MAXX(Sales,[rank])))

Result:

6.PNG

 

here is pbix, please try it.

https://www.dropbox.com/s/y78z2mozfxof0hz/Running%20Total%20on%20non%20ordered%20values.pbix?dl=0

 

Best Regards,

Lin

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

Thanks a lot!

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.