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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
agd50
Helper V
Helper V

Dynamic Slicer (Excluding the current Quarter)

Hello Power BI Fam,

I am looking to automate my reporting as much as I can, I'm having trouble with automating slicers so that they show only all quarters excluding the current quarter (Screenshots attached). How would you automate this?

agd50_0-1696468640679.png

agd50_1-1696468674405.png

I have to right click and exclude the quarter I don't want but some measure/automation would be ideal. Thanks

 

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

Hi @agd50 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a measure as below

Flag = 
VAR _date =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    IF (
        YEAR ( _date ) = YEAR ( TODAY () )
            && QUARTER ( _date ) = QUARTER ( TODAY () ),
        0,
        1
    )

2. Create a slicer which applied the field [Date] of date dimension table and apply a visual-level filter with the condition (Flag is 1)

vyiruanmsft_0-1697790793912.png

Best Regards

Community Support Team _ Rena
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

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @agd50 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a measure as below

Flag = 
VAR _date =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    IF (
        YEAR ( _date ) = YEAR ( TODAY () )
            && QUARTER ( _date ) = QUARTER ( TODAY () ),
        0,
        1
    )

2. Create a slicer which applied the field [Date] of date dimension table and apply a visual-level filter with the condition (Flag is 1)

vyiruanmsft_0-1697790793912.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
agd50
Helper V
Helper V

Problem with relative Date Filter/slicer: It will leave me some data that is not what I'm looking for then I will have to manually (not automated) remove the dates I don't want. Example below: (Using relative date to include only 4 years but then it will include 2019 which I don't want, if I use years then it will exclude 2023 - current year)

agd50_1-1696474143532.png

 

parry2k
Super User
Super User

@agd50 do you even know what I'm talking about? Create a relative date slicer or filter in Power BI - Power BI | Microsoft Learn



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@agd50 have you looked at relative date filtering? 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I don't think that will work as I want them to be able to select year and quarter in the slicer, instead of single dates

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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