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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Thigs
Helper III
Helper III

Calculated Column Running Total

Hi all, 

I've looked at several other posts answering similar questions but can't find exactly what I need. Basically, I have a column for Index (starting at 1), and a column for quantity of items. I want to do a running total of the quantity based on the Index column - but it needs to be in a calculated column rather than a measure as I need to use the column itsself for an additional analysis in a bit. I have tried the following, but it doesn't work - 

 

Cumulative Total =
CALCULATE (
SUM('Data'[QtyPicked]),
FILTER (
ALL( 'Data'[Index] ),
'Data'[Index] <= MAX ( 'Data'[Index] )
)
)
 
It seems to just be giving me the quantity, not the running quantity
 
I also tried something like this - 
Running Total = if('Data'[Index] = 1, 'Data'[QtyPicked],
CALCULATE(sum('Data'[QtyPicked]),
FILTER( 'Data'[Index] <= MAX('Data'[Index]))))
 
Which also gave crazy numbers, so no good either. 
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Thigs 

for a calculated column you can use 

Cumulative Total =
SUMX (
    FILTER ( 'Data', 'Data'[Index] <= EARLIER ( 'Data'[Index] ) ),
    'Data'[QtyPicked]
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @Thigs 

for a calculated column you can use 

Cumulative Total =
SUMX (
    FILTER ( 'Data', 'Data'[Index] <= EARLIER ( 'Data'[Index] ) ),
    'Data'[QtyPicked]
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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