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

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

Reply
Anonymous
Not applicable

How to get add a cumulative column starting with highest value.

Hello. I need help in making a column with cumulative value from a different column. See below for my sample data. I already tried some being suggested online, but non works for my set of data.

burrito_0-1700732598290.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

That looks like a line graph that you have there. If you have one row per ID you could use the below:

TobyNye_1-1700744668740.png

Raw measure code:

Single Value = SELECTEDVALUE(Data[Cumulative Total])
 
I think aggregation would be more suitable, you can either click the dropdown on the column and change it to SUM, this would effectively return the sum of all the values next to whatever is on your x-axis (presumably ID, but could be anything else you have in your table). This will still work even if there is only one value, you could also create a measure to find the sum of the column and use that instead, any of these should work for you:
TobyNye_2-1700744799847.pngTobyNye_3-1700744835412.png

 

You could even just create the cumulative total as a measure and use that on your graph:

TobyNye_4-1700745064052.png

Raw measure code:

Cumulative Total (measure) =
CALCULATE(SUM(Data[Value]), FILTER(ALL(Data),
                                Data[Value] >= SUM(Data[Value])
)
)
 
Hope this helps, let me know how you get on.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

I built a sample dataset with small numbers to make checking it easier, I believe the following meets your requirements:

TobyNye_0-1700737544251.png

Raw measure code:

Cumulative Total =
VAR _cur_val = CALCULATE(SUM(Data[Value]), Data[ID] = Data[ID])
VAR _cum_val = CALCULATE(SUM(Data[Value]), FILTER(ALL(Data),
                                                Data[Value] <= _cur_val
)
)
RETURN
_cum_val                
 
Hope this helps, let me know if you have any issues or further questions.
Anonymous
Not applicable

Realise I slightly misread the problem, should be >= instead of <= as below:

TobyNye_1-1700737679844.png

 

Anonymous
Not applicable

It works well, thank you! I now have a column with the cumulative value starting from highest value.

 

My new problem is when I use the columns in my line axis visual, it automatically transforms to count and not the actual value. See below.

burrito_1-1700742751361.png

How do I fix this to show the actual value instead of count?

Anonymous
Not applicable

That looks like a line graph that you have there. If you have one row per ID you could use the below:

TobyNye_1-1700744668740.png

Raw measure code:

Single Value = SELECTEDVALUE(Data[Cumulative Total])
 
I think aggregation would be more suitable, you can either click the dropdown on the column and change it to SUM, this would effectively return the sum of all the values next to whatever is on your x-axis (presumably ID, but could be anything else you have in your table). This will still work even if there is only one value, you could also create a measure to find the sum of the column and use that instead, any of these should work for you:
TobyNye_2-1700744799847.pngTobyNye_3-1700744835412.png

 

You could even just create the cumulative total as a measure and use that on your graph:

TobyNye_4-1700745064052.png

Raw measure code:

Cumulative Total (measure) =
CALCULATE(SUM(Data[Value]), FILTER(ALL(Data),
                                Data[Value] >= SUM(Data[Value])
)
)
 
Hope this helps, let me know how you get on.
Anonymous
Not applicable

This was the same measure formula I used before and guess where I went wrong?
I used <= instead of >=

 

Thank you very much! This was the solution I'm looking for.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.