cancel
Showing results for
Did you mean:
Helper I

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 + 2020Q1

In Genral, last one Year total I wanted to cummulate. How to do this?

2 ACCEPTED SOLUTIONS
Community Support

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.

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

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.

Helper I

Thank You so much....its working as expected😊

5 REPLIES 5
Community Support

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.

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

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.

Helper I

Thank You so much....its working as expected😊

Community Support

Glad to hear that you have sloved this problem, would you like to mark my reply as a solution so that others can learn from it too?

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.

Helper I

Hi Amit I dont have date column in the table to relate with date dimention, I have only Year and Quarter

Super User IV

@Kasireddyvina , Create a rank on Year Qtr (Make sure Qtr in separate table,say date)

New column

Qtr Rank = RANKX(all('Date'),'Date'[Year Qtr],,ASC,Dense)  //YYYYQ

Lst 4 Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]<=max('Date'[Qtr Rank]) &&

'Date'[Qtr Rank]>=max('Date'[Qtr Rank]) -4

))

if you have date

Rolling 4 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-4,QUARTER))

Proud to be a Super User!

Announcements