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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Shak_Stoke
Frequent Visitor

Show last 5 quarter (15 months) when i select any Quarter-Year from slicer

Hi there, 

 

I have a finance data and want to show last 5 complate quarters months in Matrix Column when i select any Quarter-Year from slicers.

For example, I have two year data from Jan-2020 till Dec-2021. Now i have Quarter year slicer and when i select Q4-2021 my Matrix should show all previous 15 months-Year (From Sep-2021 till Jul-2020) for last 5 complete quarters i.e Q3-2021, Q2-2021,Q1-2021,Q4-2020,Q3-2020. 

 

Slicer                
Q4-2021               
                
CureencySep-21Aug-21Jul-21Jun-21May-21Apr-21Mar-21Feb-21Jan-21Dec-20Nov-20Oct-20Sep-20Aug-20Jul-20
USD155615644564654522554846665668987982246694564636
1 ACCEPTED SOLUTION

CNENFRNL_0-1666389085745.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

4 REPLIES 4
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1666289323681.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thanks a lot for your help. Really appreciate it. 

I need another favour related to this. Now i want to create two measures one for last 4 quarter and another for prior running 4 quarters.

I have craeted last 4 Qtr by using above logic and it worked but for prior runing it's not working 

 

For Last 4Qtr  e.g if we see above example and select Q4-2021 in our slicer then Last 4Qtr should show Q3-2021, Q2-2021, Q1-2021 and Q4-2020

I used below measure and it worked

Last 4Qtr =
CALCULATE(
    SUM( TXN[Qty] ),
    DATESINPERIOD( DATES[Date], MIN( DATES[Date] ) - 1, -4, QUARTER )
 
Now i want to create Prior runing 4 qtr total e.g if we see above example and select Q4-2021 in slicer then Prior 4 Qtr measure should show Q2-2021, Q1-2021, Q4-2020 and Q3-2020.
 
Can you please help with this?

CNENFRNL_0-1666389085745.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thanks for sharing this.  Apologies i think i wasn't clear in my previous post. We don't need running qtr But the requirement is we want to skip 2 qtr as in the above example 20221 is selected in slicer and table is showing  2021-Q4, 2021-Q3, 2021-Q2 and 2021-Q1 . However, we want to show 2021-Q3, 2021-Q2, 2021-Q1 and 2020-Q4.

Thanks 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.