Forum Discussion

Miska's avatar
Miska
Icon for Helper I rankHelper I
4 years ago
Solved

Hide/Unhide Slicer based on another slicer values

Hi!   I am looking to hide slicer 1 based on values selected on Slicer 2 on my PowerBI report. For example if I select 2021 on slicer 2 I want the Slicer 1 to be hidden or invisible, whereas if I s...
  • v-kkf-msft's avatar
    4 years ago

    Hi Miska ,

     

    Currently it is not possible to make another slicer invisible based on the value in the slicer. But you can hide the slicer by making the value in this slicer empty and the font and background color transparent.


    The steps are as follows.


    1. Create the following measures.

     

    Measure = 
    IF (
        SELECTEDVALUE ( Dates[Year] ) = 2021,
        COUNTROWS ( 
            INTERSECT ( 
                VALUES ( 'Table'[Category] ), 
                { BLANK () } 
            ) 
        ),
        COUNTROWS ( VALUES ( 'Table'[Category] ) ) 
    )
    Color = 
    IF (
        SELECTEDVALUE ( Dates[Year] ) = 2021, 
        "#FFFFFF00"
    )

     

    2. Use Measure to filter the Category field in the slicer.

     

     

    3. Change the Font and Background color for Category slicer, and make it transparent when 2021 is selected.


           


    4. The final result is as follows, the Category slicer will be hidden when 2021 is selected. 

     

         

     

    Note that make sure to clear the Category slicer selection before selecting 2021, otherwise the following result will be displayed.

     

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.