Can someone help me: How to show the last 4 previous Quarters and how to sum the last 5 quarters

Dear all,
Can someone help me with these 2 requests?

We have some Results counting through this function:
Results = if(NOT isinscope(Results[Result (+/-)]) && HASONEVALUE(Results[Result (+/-)]), BLANK(), COUNTROWS(TimestampExportReport) )

At the moment we show only 1 quarter’s Results through the Filter Pane where we select 3 months of that Quarter in the Filter Pane.
We do Current % through current Results in Values where we display %GT

The questions are these:

  1. How to show the previous 4 quarters if we filter only 1 quarter in Filters as we do right now?
  2. How to Sum the 5 quarters?

This is the current situation that we did:

This is what we need, which we have done in excel to explain.

p.s.: We use the Filter Pane because through it the User filter all the Sheets we have by one quarter, but in this sheet, we also need the information for the previous 4 quarters. The user only filters months of one Quarter and then exports to PDF all pages

Thank you in advance.
Results_Test.xlsx (14.3 KB)

@edipgashi Share PBIX.

Hi @edipgashi

We aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.
  • When posting a topic with a formula make sure that it is correctly formatted to preformatted text </>.


  • Use the proper category that best describes your topic
  • Provide as much context to a question as possible.
  • Include the masked demo pbix file, images of the entire scenario you are dealing with, a screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delays in getting an answer.

Please also check the How To Mask Sensitive Data thread for some tips on how to mask your pbix file.

Hello @AntrikshSharma

I am not able to share PBIX, because there is a lot of sensitive data and at the moment it will take me a lot of time to classify only what we need. (my deadline is for tomorrow)

I’m explaining it again, maybe you can understand me:
How to show through calculation the previous 4 quarters even if I have filtered only 1 quarter (3 months) in the Filter Pane… Is there any possibility to do this? Something like Filter(All… from last 4 quarters until filtered quarter (months), and every quarter will be separated in the column.
And the next question is how to Sum all these quarters displayed in only 1 column through DAX.

Maybe now if you see the pictures above you can understand easily my requests.

Thank you

Dear all,

I did one calculation that is showing what I need, in 4 previous quarters but now when I bring a category it disappears although the relationship is fine and works properly.
If I put the same category in the Filter pane, it works well.
Can someone know where the problem should be?

These are the calculations that I did:

This is for the count:
*Total Number = if(NOT isinscope(Results[Result (+/-)]) && HASONEVALUE(Results[Result (+/-)]), BLANK(), COUNTROWS(TimestampExportReport) )

I did a table for only Years and Quarters.

After that, I did this calculation where I put as a filter on the filter pane and everything is good till now:
Flag =
var _max=SELECTEDVALUE(ForSlicer[YearQuarter])
var _min=CALCULATE(MAX(‘ForSlicer’[YearQuarter]),FILTER(ALL(‘ForSlicer’),‘ForSlicer’[Index]=SELECTEDVALUE(ForSlicer[Index])-3))
VAR _yearQuarter =
MAX ( ‘Calendar’[Years] ) * 100
+ MAX (‘Calendar’[Qtr])
return IF(_yearQuarter<=_max &&_yearQuarter>=_min,1,0)

As I said when I put the Category, it disappears the result.

I did this video where you can see it.


Edip EDNA.pbix (574.5 KB)

Hello @edipgashi

Did the response from @AntrikshSharma (thank you) help solve your query?

If not, can you let us know where you’re stuck and what additional assistance you need?

If it did, please mark the answer as the SOLUTION.

Thank you

Hello @edipgashi

Just following up if the response above help you solve your inquiry.
If it did, please mark his answer as the SOLUTION.

We’ve noticed that no response was received from you on the post above. In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

Hi @edipgashi

Due to inactivity, a response on this post has been tagged as “Solution”.

If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.

We request you to kindly take time to answer the Enterprise DNA Forum User Experience Survey,.

We hope you’ll give your insights on how we can further improve the Support forum. Thanks!

@AntrikshSharma will you please tell me how to calculate year quarter number column you use in your Measure on which base calculate last 5 year, because in my data did not have this column i have only year and Quarter and date filed please your urgent response required.

Measure =
VAR SelectedQuarter =
SELECTEDVALUE ( DisconnectedDates[Year Quarter Number] )
VAR PreviousNQuarters =
VALUES ( Dates[Year Quarter Number] ),
Dates[Year Quarter Number] < SelectedQuarter,
Dates[Year Quarter Number] >= SelectedQuarter - 4,
VAR Result =
[Sales Amount],
KEEPFILTERS ( PreviousNQuarters )


Year Quarter Number Sequential = 
YEAR ( Dates[Date] ) * 4 - 1 + QUARTER ( Dates[Date] )
Year Month Number Sequential = 
YEAR ( Dates[Date] ) * 12 - 1 + MONTH ( Dates[Date] )
1 Like

Thanks a lot @AntrikshSharma


@AntrikshSharma thanks for helping me . I used same measure(last five year) to calculate last two quarters please tell me who to calculate variance% on these two quarters. i mean in next column i want variance% as well.
Thanks in advance