Forum Discussion

learner03's avatar
learner03
Icon for Post Partisan rankPost Partisan
4 years ago
Solved

Cumulative sum Based on Measure

How can I get the desired Cumulative Sum Column?

To be noted that The Location Count column result is calculated Measure and is not directly coming from a column

 

 

3 Replies

  • Hi learner03 ,

     

    Below are example formula on how to calculate cumulative value. The calculation is based on the alphabetical sorting of order number column.

    Cumulative Value - Measure = 
    CALCULATE (
        SUM ( Data[Value] ),
        FILTER ( ALL ( Data ), Data[Order Number] <= MAX ( Data[Order Number] )
    )
    )
    Cumulative Value - Column = 
    CALCULATE (
        SUM ( Data[Value] ),
        FILTER ( ALL ( Data ), Data[Order Number] <= EARLIER ( Data[Order Number] ) )
    )