Forum Discussion

nranito's avatar
nranito
Helper II
8 years ago
Solved

Cumulative sum by columns

I have a table REQ in which I want to count values each day and show in a graph the cumulative sum,

I used measure

 

Acumulate = CALCULATE(count(Reqs[ID]),FILTER(ALLSELECTED(Reqs),Reqs[DAY]<=MAX(Reqs[DAY] ) ))  

 

Now I need the same, CUMULATIVE sum per day, but group by a column

 

Any thoughts?

 

Thank you for any help

 

  • Hi nranito,

     

     

    Do you want to get a output like below? Calculate the cumulative sum of Sales per day and group by Type.

     

    If it is, you could refer to this measure.

     

    Measure 2 =
    CALCULATE (
        SUM ( Table1[Sales] ),
        FILTER (
            ALLEXCEPT ( 'Table1', Table1[Type] ),
            'Table1'[Day] <= MAX ( 'Table1'[Day] )
        )
    )
    

    If not, please share your data sample which could reproduce your scenario and your desired output.

     

    Best Regards,

    Cherry

3 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi nranito,

     

     

    Do you want to get a output like below? Calculate the cumulative sum of Sales per day and group by Type.

     

    If it is, you could refer to this measure.

     

    Measure 2 =
    CALCULATE (
        SUM ( Table1[Sales] ),
        FILTER (
            ALLEXCEPT ( 'Table1', Table1[Type] ),
            'Table1'[Day] <= MAX ( 'Table1'[Day] )
        )
    )
    

    If not, please share your data sample which could reproduce your scenario and your desired output.

     

    Best Regards,

    Cherry

    • nranito's avatar
      nranito
      Helper II

      It's just that, thank you!

       

      Can you explain what "allexcept" does? I tried, as you pointed, using GROUP BY, with no success...