Forum Discussion

SalemWafiHttech's avatar
SalemWafiHttech
New Member
7 years ago
Solved

How to add cumulative values Column based on another column values

Imagine if I have the following tabe:

Date                              WorkPercentage
_____________________________________________________
April,1                                       30

May,1                                        29

June,1                                        31

July, 1                                        10
_____________________________________________________

And I want to add an aggregatied column called CumulativeWorkPercenage that sum the AmountOfDoneWorkPercentage row by row and the table will be look like:

 

Date                              WorkPercentage             CumulativeWorkPercenage
________________________________________________________________________________
April,1                                       30                                            30

May,1                                        29                                            59

June,1                                        31                                            90

July, 1                                        10                                            100
_________________________________________________________________________________

  • Hi SalemWafiHttech,

     

    Based on your requirement, you could create a measure with the formula below to achieve that.

     

    Measure =
    CALCULATE (
        SUM ( 'Table1'[WorkPercentage] ),
        FILTER ( ALL ( 'Table1' ), 'Table1'[Date] <= MAX ( 'Table1'[Date] ) )
    )
    

    Here is the output,

     

     

    Best Regards,

    Cherry

1 Reply

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi SalemWafiHttech,

     

    Based on your requirement, you could create a measure with the formula below to achieve that.

     

    Measure =
    CALCULATE (
        SUM ( 'Table1'[WorkPercentage] ),
        FILTER ( ALL ( 'Table1' ), 'Table1'[Date] <= MAX ( 'Table1'[Date] ) )
    )
    

    Here is the output,

     

     

    Best Regards,

    Cherry