Forum Discussion

Dirk_Kuypers's avatar
Dirk_Kuypers
Frequent Visitor
6 years ago
Solved

running total

Hello,

 

I am trying to create a running total for my PPT (Potential Production Time) for different production lines for eacht month.

 

There are 5 lines and for each line a PPT for each month.

I want a CumPPT for each line. 

LineYearMonthPPTCumPPT
120191452452
120192502954
1201933451299
2201917878
22019298176
220193101277
320191345345
320192554899
3201932341133

 

I created a column  CumPPT but I cannot get the calculation.

  • Hi Dirk_Kuypers ,

     

    Maybe you can do like this:

     

    Total_running = 
    
    CALCULATE(
        SUM(Sheet1[PPT]),
        FILTER(
            Sheet1,
            Sheet1[Month] <= EARLIER(Sheet1[Month]) && Sheet1[Line] = EARLIER(Sheet1[Line])
        )
    )

     

     

    Best regards,
    Lionel Chen

     

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

1 Reply

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Dirk_Kuypers ,

     

    Maybe you can do like this:

     

    Total_running = 
    
    CALCULATE(
        SUM(Sheet1[PPT]),
        FILTER(
            Sheet1,
            Sheet1[Month] <= EARLIER(Sheet1[Month]) && Sheet1[Line] = EARLIER(Sheet1[Line])
        )
    )

     

     

    Best regards,
    Lionel Chen

     

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