Forum Discussion

PeterChu's avatar
PeterChu
Frequent Visitor
8 years ago
Solved

Running sum by date , person

Hi Everyone,

I am trying to do a running sum by group in PowerBi DeskTop. Thank you.

 

Here is what my data looks like, I would like a running sum of the times in a new column.

Thank you all.

 

 

  • Hi PeterChu

     

    If you want to do it as a calculated column then please try this :

     

    Running Total = 
        CALCULATE(
            SUM(Table1[Times]),
            FILTER(
                'Table1',
                'Table1'[MemberId]=EARLIER('Table1'[MemberId])
                && 'Table1'[Date] <= EARLIER('Table1'[Date])
                )
                )

3 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi PeterChu

     

    If you want to do it as a calculated column then please try this :

     

    Running Total = 
        CALCULATE(
            SUM(Table1[Times]),
            FILTER(
                'Table1',
                'Table1'[MemberId]=EARLIER('Table1'[MemberId])
                && 'Table1'[Date] <= EARLIER('Table1'[Date])
                )
                )
  • sunshine1's avatar
    sunshine1
    Frequent Visitor

    thanks this formula worked. I saw a bunch of other threads for running total but this was the only one that got the desired result.....