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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
cn4422
Helper V
Helper V

Date Slicer Showing Previous Quarter

Hi,

 

I would like to create a dynamic slicer that automatically is set to and shows the previous quarter.

I have a date table but I'm not quite sure how to accomplish this. Probably with a DAX formula?

 

Here is the link to the example data:

Sample Data 

 

Thx for your help! 😊

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from sjoerdvn , please allow me to provide another insight:

Hi, @cn4422 

I offer you two options to achieve this need:

1.First, use the quarter and year of the auto-date as the slicer, as shown in the following image:

vlinyulumsft_0-1727166631712.png

The downside is that you need to manually go to the click.

2.Second, use the following measure:

MEASURE = 
IF (
    QUARTER ( MAX ( 'Datum'[Date] ) )
        = QUARTER ( TODAY () ) - 1
        && YEAR ( MAX ( 'Datum'[Date] ) ) = YEAR ( TODAY () ),
    1
)

And apply it to the visualization:

vlinyulumsft_1-1727166691768.png

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

8 REPLIES 8
sjoerdvn
Super User
Super User

In Table view, select Table Tools and "New Column" Then add the definition below

sjoerdvn_0-1727191843805.png

Relative quarter = 
VAR rq = QUARTER([date])
VAR tq = QUARTER(TODAY())
VAR ry = YEAR([date])
VAR ty = YEAR(TODAY())
RETURN rq - tq + 4 * (ry - ty)

Hi @sjoerdvn !
Thanks for the clarification, that worked pretty well! 👍😀

sjoerdvn
Super User
Super User

I usually add "relative" calculated columns to the date dimension table. So "relative quarter" would be 1 for next quarter, 0 for the current , -1 for the previous and -2 for the quarter before the previous etc. Likewise for year, month, week and day. This way you can also easily report on the last 3 months.

Thanks for your reply! 

 

I'm not 100% sure how to do this...

Should I add a new Column into the date table (the one from the sample data) - or do I need to create a new dimension table where I put the "relative quarter"?

Can't download the sample data (link is blocked) but the column(s) must be added to the existing date dimension table.

Thanks for your reply @sjoerdvn 

 

Strange that the download didn't work with google drive link (I have uploaded again, this time with a dropbox link - you can (usually) download the file just bei declining to register, in case you don't have a DP account).

 

Download Sample Data

 

I have here a screenshot from the date table and actually I don't know how to include the "relative quarter" into this... or did you mean to create a new dimension table with a relationship to the existing date table?

 

Date Table Ex.png

 

Anonymous
Not applicable

Thanks for the reply from sjoerdvn , please allow me to provide another insight:

Hi, @cn4422 

I offer you two options to achieve this need:

1.First, use the quarter and year of the auto-date as the slicer, as shown in the following image:

vlinyulumsft_0-1727166631712.png

The downside is that you need to manually go to the click.

2.Second, use the following measure:

MEASURE = 
IF (
    QUARTER ( MAX ( 'Datum'[Date] ) )
        = QUARTER ( TODAY () ) - 1
        && YEAR ( MAX ( 'Datum'[Date] ) ) = YEAR ( TODAY () ),
    1
)

And apply it to the visualization:

vlinyulumsft_1-1727166691768.png

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,

thanks for your reply, I went with solution #2 and it worked just fine! 😉

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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