Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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, @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:

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

Anonymous
Not applicable

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

View solution in original post

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

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:

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.

Anonymous
Not applicable

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

Hi, @Anonymous 

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.

Anonymous
Not applicable

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

amitchandak
Super User
Super User

@Anonymous , 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))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.