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.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors