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

Cumulative Running Total in Power BI Table

My dataset has the below values. Name is a normal field and amount % is a calculated measure value. 

 

I need to create a calculated measure or a column to make the cumulative running total % as given in the Column 3. 

 

How can we do it ?

 

Ramees_123_2-1618491133809.png

 

 

 

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

Hi, @Ramees_123 

 

According to your description,you could first create a index column in Power Query: transform data->add column->index column

v-yalanwu-msft_0-1618817786403.jpeg

Then create a measure by the following formula:

Total =
CALCULATE (
    SUM ( 'Table'[Amount%] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Index] <= MAX ( 'Table'[Index] ) )
)


Or

Create a measure based on the number(1,2,3,4) in [Name] column.

Total2 =
VAR _index =
    MID ( MAX ( 'Table'[Name] ), 8, 10 )
RETURN
    SUMX (
        FILTER ( ALL ( 'Table' ), MID ( 'Table'[Name], 8, 10 ) <= _index ),
        [Amount%]
    )

The final output is shown below:
Total.jpg

Best Regards,
Yalan Wu
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-yalanwu-msft
Community Support
Community Support

Hi, @Ramees_123 

 

According to your description,you could first create a index column in Power Query: transform data->add column->index column

v-yalanwu-msft_0-1618817786403.jpeg

Then create a measure by the following formula:

Total =
CALCULATE (
    SUM ( 'Table'[Amount%] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Index] <= MAX ( 'Table'[Index] ) )
)


Or

Create a measure based on the number(1,2,3,4) in [Name] column.

Total2 =
VAR _index =
    MID ( MAX ( 'Table'[Name] ), 8, 10 )
RETURN
    SUMX (
        FILTER ( ALL ( 'Table' ), MID ( 'Table'[Name], 8, 10 ) <= _index ),
        [Amount%]
    )

The final output is shown below:
Total.jpg

Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Ramees_123 , Please try a measure like

calculate(Sumx(Values(Table[Name]),[Amount %]), filter(allselected(Table), Table[Name] =max(Table[Name])))

 

Else you have to this only for numerator of you measure

calculate(Sum(Table[Amount]), filter(allselected(Table), Table[Name] =max(Table[Name])))

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.