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
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.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors