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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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