Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Running total for last 4 Quarters

Hi, I need to Calculate the Running total for last 4 Quarters only. My Table shown below   Example 01: 2021Q1 = 2021Q1+2020Q4+2020Q3 + 2020Q2 Example 02: 2020Q4 = 2020Q4+2020Q3+2020Q2 + ...
  • v-robertq-msft's avatar
    5 years ago

    Hi, Anonymous 

    According to your description, you want to get the running total of the last four quarters, I think you can achieve this using calculated column, you can try these calculated columns:

    Index =
    
    RANKX('Table',[Year quater],,ASC,Dense)
    Sum of capas due =
    
    CALCULATE(
    
        SUM('Table'[# of capas due]),
    
        FILTER(ALLSELECTED('Table'),
    
        [Index]<=EARLIER('Table'[Index])&&
    
        [Index]>=EARLIER('Table'[Index])-3 ))
    Sum of Due-Ontime =
    
    CALCULATE(
    
        SUM('Table'[# of Due-Ontime]),
    
        FILTER(ALLSELECTED('Table'),
    
        [Index]<=EARLIER('Table'[Index])&&
    
        [Index]>=EARLIER('Table'[Index])-3 ))

    Then you can get the output like this:

     

    Then you can create a table chart and place it like this:

     

    And you can get what you want.

    You can download my test pbix file here

     

    If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

     

    Best Regards,

    Community Support Team _Robert Qin

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

  • Anonymous's avatar
    Anonymous
    5 years ago

    Thank You so much....its working as expected๐Ÿ˜Š