cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kasireddyvina
Helper I
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

 

Kasireddyvina_0-1614329849807.png

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
v-robertq-msft
Community Support
Community Support

Hi, @Kasireddyvina 

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:

v-robertq-msft_0-1614587418193.png

 

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

v-robertq-msft_1-1614587418201.png

 

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.

View solution in original post

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

View solution in original post

5 REPLIES 5
v-robertq-msft
Community Support
Community Support

Hi, @Kasireddyvina 

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:

v-robertq-msft_0-1614587418193.png

 

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

v-robertq-msft_1-1614587418201.png

 

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.

View solution in original post

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

View solution in original post

Hi, @Kasireddyvina 

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?

Thanks in advance!😊

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.

Kasireddyvina
Helper I
Helper I

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

amitchandak
Super User IV
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))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors