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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Dynamic quarter chart without slicer

Hi all,

 

I want to show sales for rolling last 8 quarters. My FY cycle is June-May.

 

For example if I take March '22, the bar chart should show previous 8 quarters of data, i.e

2022 - Q1, Q2, Q3.

2021 - Q1, Q2, Q3, Q4.

2020 - Q4

 

Uptil the end of this quarter which would be in May '22, the above mentioned quarters should only be shown. As soon as I move to Q1 '23, the chart should show bars of 2022 - Q1 to Q4 and 2021 - Q1 to Q4 so on and so fourth. Also this chart should not be governed by any date slicer, say year or month, it should be a standalone chart.

 

Any help on how can I able to achieve this would be appreciated.

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

I create the following Dates table and relationship.

 

vkkfmsft_0-1646895241084.png   vkkfmsft_1-1646895265771.png

 

Then please try the measure:

 

Measure = 
VAR CurrentDate =
    TODAY ()
VAR CurYear_Qua =
    CALCULATE (
        MAX ( Dates[FY_Year] ) & MAX ( Dates[FY_Quarter] ),
        Dates[Date] = CurrentDate
    )
VAR Qua_FirstDay =
    CALCULATE (
        MIN ( Dates[Date] ),
        FILTER ( ALL ( Dates ), Dates[FY_Year] & Dates[FY_Quarter] = CurYear_Qua )
    )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            Dates,
            Dates[Date] >= EDATE ( Qua_FirstDay, -24 )
                && Dates[Date] < Qua_FirstDay
        )
    )

vkkfmsft_2-1646895314278.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

I create the following Dates table and relationship.

 

vkkfmsft_0-1646895241084.png   vkkfmsft_1-1646895265771.png

 

Then please try the measure:

 

Measure = 
VAR CurrentDate =
    TODAY ()
VAR CurYear_Qua =
    CALCULATE (
        MAX ( Dates[FY_Year] ) & MAX ( Dates[FY_Quarter] ),
        Dates[Date] = CurrentDate
    )
VAR Qua_FirstDay =
    CALCULATE (
        MIN ( Dates[Date] ),
        FILTER ( ALL ( Dates ), Dates[FY_Year] & Dates[FY_Quarter] = CurYear_Qua )
    )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            Dates,
            Dates[Date] >= EDATE ( Qua_FirstDay, -24 )
                && Dates[Date] < Qua_FirstDay
        )
    )

vkkfmsft_2-1646895314278.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , if you select one date and want to display more than one date (period) then you need an independent date table

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I already have a date table in place, which takes min and max dates values from the data table.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.