cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jvolden
Frequent Visitor

Is it possible to have a date slicer filter one visual by month and another visual by quarter?

Hello,

 

I have a date slicer I am using a date heirarchy in. My goal is to select a month-year combo in the slicer and then have one visual filter to that specific selection and another visual filter to the relevant quarter associated with the selected month. I'm struggling to work out a way to use a single date slicer to filter on different date parts in different visuls.

 

Any ideas out there? 

1 ACCEPTED SOLUTION
Eyelyn9
Community Support
Community Support

Hi @jvolden ,

 

Sorry for my late reply firstly. 

 

You could follow these steps below to achieve your needs.

 

1.Extract the Date column to create a single table for slicer:

ForSlicer =
SELECTCOLUMNS ( 'Table', "Date", [Date] )

 

2.Use the following formula to create measure and apply it to filter pane ,set as "is 1" for visual1

for YearMonth =
    VAR _seleYear =
        SELECTEDVALUE ( 'ForSlicer'[Date].[Year] )
    VAR _seleMonth =
        SELECTEDVALUE ( 'ForSlicer'[Date].[MonthNo] )
    RETURN
        IF (
            YEAR ( MAX ( 'Table'[Date] ) ) = _seleYear
                && MONTH ( MAX ( 'Table'[Date] ) ) = _seleMonth,
            1,
            0
        )

 

3. Almost the same as step2 for visual2

for Quarter =
VAR _seleYear =
    SELECTEDVALUE ( 'ForSlicer'[Date].[Year] )
VAR _seleMonth =
    SELECTEDVALUE ( 'ForSlicer'[Date].[MonthNo] )
VAR _quar =
    MAXX (
        FILTER ( ALL ( 'Table' ), 'Table'[Date].[MonthNo] = _seleMonth ),
        QUARTER ( [Date] )
    )
RETURN
    IF (
        YEAR ( MAX ( 'Table'[Date] ) ) = _seleYear
            && QUARTER ( MAX ( 'Table'[Date] ) ) = _quar,
        1,
        0
    )

 

The final output is shown below:

1.20.2.1.gif

 

Please kindly take a look at the pbix file here.

 

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
Eyelyn9
Community Support
Community Support

Hi @jvolden ,

 

Sorry for my late reply firstly. 

 

You could follow these steps below to achieve your needs.

 

1.Extract the Date column to create a single table for slicer:

ForSlicer =
SELECTCOLUMNS ( 'Table', "Date", [Date] )

 

2.Use the following formula to create measure and apply it to filter pane ,set as "is 1" for visual1

for YearMonth =
    VAR _seleYear =
        SELECTEDVALUE ( 'ForSlicer'[Date].[Year] )
    VAR _seleMonth =
        SELECTEDVALUE ( 'ForSlicer'[Date].[MonthNo] )
    RETURN
        IF (
            YEAR ( MAX ( 'Table'[Date] ) ) = _seleYear
                && MONTH ( MAX ( 'Table'[Date] ) ) = _seleMonth,
            1,
            0
        )

 

3. Almost the same as step2 for visual2

for Quarter =
VAR _seleYear =
    SELECTEDVALUE ( 'ForSlicer'[Date].[Year] )
VAR _seleMonth =
    SELECTEDVALUE ( 'ForSlicer'[Date].[MonthNo] )
VAR _quar =
    MAXX (
        FILTER ( ALL ( 'Table' ), 'Table'[Date].[MonthNo] = _seleMonth ),
        QUARTER ( [Date] )
    )
RETURN
    IF (
        YEAR ( MAX ( 'Table'[Date] ) ) = _seleYear
            && QUARTER ( MAX ( 'Table'[Date] ) ) = _quar,
        1,
        0
    )

 

The final output is shown below:

1.20.2.1.gif

 

Please kindly take a look at the pbix file here.

 

Best Regards,
Eyelyn Qin
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

aj1973
Community Champion
Community Champion

Hi @jvolden 

Create 2 different slicers one for month and one for year, then use the "Edit interactions" feature of the desktop to Stop and Filter the visuals as you like.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors