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
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
v-eqin-msft
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
v-eqin-msft
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.

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