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
kkalyanrr
Helper V
Helper V

How to Make one slicer inactive by making another slicer active

Hello,

 

I'm using two slicers based on Date input, and using two slicers one Year and one Date Range.

 

My requirement is , when a user enters dates in to date range then, year slicer should be deactived(I mean this filter should be inactive,currently it allows user to select either 2013,2014).

 

939.PNG

 

Thanks..

2 ACCEPTED SOLUTIONS

@v-caliao-msft  Thanks for the info..

 

how ever, can I set one slicer more priority than the other..

 

I mean if there are 2 slicers A&B , when ever some one uses these 2 slicers together, Result should be based on A?

View solution in original post

@kkalyanrr,

 

I mean if there are 2 slicers A&B , when ever some one uses these 2 slicers together, Result should be based on A?

There is no a directly option that allow us to achieve this requirement. To work around this, we can use a measure to filter data.

Measure 2 = 
VAR selectedyear =
    MAX ( 'Table'[Year] )
VAR selectedmindate =
    MIN ( 'Table'[Date] )
VAR selectedmaxdate =
    MAX ( 'Table'[Date] )
RETURN
    IF (
        (
            ( ISFILTERED ( 'Table'[Year] ) || ISFILTERED ( 'Table'[Date] ) )
                = FALSE ()
        ),
        0,
        IF (
            ISFILTERED ( 'Table'[Year] ) = TRUE ()
                && ISFILTERED ( 'Table'[Date] ) = FALSE ()
                && MAX ( Sales[Year] ) = selectedyear,
            1,
            IF (
                ISFILTERED ( 'Table'[Year] ) = FALSE ()
                    && ISFILTERED ( 'Table'[Date] ) = TRUE ()
                    && MAX ( Sales[Date] ) >= selectedmindate
                    && MAX ( Sales[Date] ) <= selectedmaxdate,
                1,
                IF (
                    ISFILTERED ( 'Table'[Year] ) && ISFILTERED ( 'Table'[Date] )
                        && MAX ( Sales[Year] ) = selectedyear,
                    1,
                    0
                )
            )
        )
    )

I have attached the PBIX file, if I select items on two slicers, the result only based on Year slicer.

 

Regards,

Charlie Liao

View solution in original post

5 REPLIES 5
v-caliao-msft
Employee
Employee

@kkalyanrr,

 

You want year un-selectable when enter start date and end date in your range slicer, right? Currently, we can set the interaction between two visual. However, we canno disbale one slicer by another slicer. So I am afraid your requirement cannot be done in current version of Power BI.

 

Thank you for your understanding.

 

Regards,

Charlie Liao

 

 

 

 

Thanks for the reply @v-caliao-msft

 

how ever, can I set one slicer more prior than the other..

 

for ex.. I've written a measure Measure1 = Sum(Table1.Price), which can be operated by 2 slicers Date Range and Year.

 

Can I set a priority,  that Measure1 must take Date Range Input first..

 

If I'm entering date range from "13-Jan-2012" to "13-Jan-2013" ,  subsequently the year slicer gives option of "2012" or "2013". If we select "2012", so the output will be based on "13-Jan-2012" to "13-Jan-2013" /  "13-Jan-2012" to "31-Dec-2012".

 

Thanks..

@kkalyanrr,

 

If I'm entering date range from "13-Jan-2012" to "13-Jan-2013" ,  subsequently the year slicer gives option of "2012" or "2013". If we select "2012", so the output will be based on "13-Jan-2012" to "13-Jan-2013" /  "13-Jan-2012" to "31-Dec-2012".

Based on test, Power BI will not help you re-select item when you slecte item on another slicer. It will only filter out the items.  So I am afirad your requirement cannot be done currently. 

 

If you have any concern on this feature, you can submit your idea on the link below. If this feature was mentioned by mulitple users, product team will consider to add this feature to next release.
https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

Thank you for your understanding.

 

Regards,
Charlie Liao

@v-caliao-msft  Thanks for the info..

 

how ever, can I set one slicer more priority than the other..

 

I mean if there are 2 slicers A&B , when ever some one uses these 2 slicers together, Result should be based on A?

@kkalyanrr,

 

I mean if there are 2 slicers A&B , when ever some one uses these 2 slicers together, Result should be based on A?

There is no a directly option that allow us to achieve this requirement. To work around this, we can use a measure to filter data.

Measure 2 = 
VAR selectedyear =
    MAX ( 'Table'[Year] )
VAR selectedmindate =
    MIN ( 'Table'[Date] )
VAR selectedmaxdate =
    MAX ( 'Table'[Date] )
RETURN
    IF (
        (
            ( ISFILTERED ( 'Table'[Year] ) || ISFILTERED ( 'Table'[Date] ) )
                = FALSE ()
        ),
        0,
        IF (
            ISFILTERED ( 'Table'[Year] ) = TRUE ()
                && ISFILTERED ( 'Table'[Date] ) = FALSE ()
                && MAX ( Sales[Year] ) = selectedyear,
            1,
            IF (
                ISFILTERED ( 'Table'[Year] ) = FALSE ()
                    && ISFILTERED ( 'Table'[Date] ) = TRUE ()
                    && MAX ( Sales[Date] ) >= selectedmindate
                    && MAX ( Sales[Date] ) <= selectedmaxdate,
                1,
                IF (
                    ISFILTERED ( 'Table'[Year] ) && ISFILTERED ( 'Table'[Date] )
                        && MAX ( Sales[Year] ) = selectedyear,
                    1,
                    0
                )
            )
        )
    )

I have attached the PBIX file, if I select items on two slicers, the result only based on Year slicer.

 

Regards,

Charlie Liao

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.