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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
bhaskarasalla
Frequent Visitor

dynamically showing last 5 financial quarters

Hello,
Can anyone help me with below issue
I have requirement where my client want to see data for last 5 financial quater.
Client financial year start from feb 01 to jan 31.

requirement is if current fQ is 2019 Q3- then chart should be like

Finacial_year_quarter   values
2019 q3                       some values
2019 q2                       some values
2019 q1                       some values
2018 q4                       some values
2018 q3                      some values

Thanks in Advance

1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @bhaskarasalla ,

 

assuming you have a date dimension, you can solve this by adding a few columns to your dimension.

First create a column to identify current date:

currentDate = IF('Dim date'[Date]=TODAY();1;0)

Then create a column to identify current quater:

currentQuater =
CALCULATE (
    SUM ( 'Dim date'[currentDate] );
    FILTER (
        'Dim date';
        'Dim date'[quater] = EARLIER ( 'Dim date'[quater] )
            && 'Dim date'[year] = EARLIER ( 'Dim date'[year] )
    )
)

 

Then we need a column called quaterYearNumber, which is unique number for each quater-year combination, which make it possible to do some simple arithmetics:

 

quaterYearNumber = ('Dim date'[year]-2016)*4+'Dim date'[quater]

Then we finally create a column called Last 5 quaters flag:

Last 5 quaters flag=
VAR _current =
    CALCULATE (
        MIN ( 'Dim date'[quaterYearNumber] );
        FILTER ( 'Dim date'; 'Dim date'[currentDate] = 1 )
    )
RETURN
    IF (
        'Dim date'[quaterYearNumber] > _current - 5
            && 'Dim date'[quaterYearNumber] <= _current;
        1;
        0
    )


You can add [Last 5 quaters flag] to the visual filter area of any visual, and set it equal to 1, and it will show only the last 5 quaters. And it will be dynamic, it will always reflect on the current date.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.