Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

undefined

how to dynamically show and hide slicers using dax

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Anonymous 

    DAX itself does not directly support showing or hiding slicers. As amitchandak explains, you can use bookmarks and buttons to create snapshots of the different states in your report, and then toggle those states through the interaction of buttons or other visuals. Here are my additions:

     

    Start by selecting Bookmark on the Vie page of the main page

     

    Then create two bookmarks in different states, create two buttons, and bind Bookmark1 and Bookmark2 to the two buttons

     

    In Bookmark2, we hide the table. Then ctrl+click the button to jump to Bookmark2, and click the second one to jump back to Bookmark1

     

     

     

     

     

    How to Get Your Question Answered Quickly 

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

    Best Regards

    Yongkang Hua

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

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Anonymous 

    DAX itself does not directly support showing or hiding slicers. As amitchandak explains, you can use bookmarks and buttons to create snapshots of the different states in your report, and then toggle those states through the interaction of buttons or other visuals. Here are my additions:

     

    Start by selecting Bookmark on the Vie page of the main page

     

    Then create two bookmarks in different states, create two buttons, and bind Bookmark1 and Bookmark2 to the two buttons

     

    In Bookmark2, we hide the table. Then ctrl+click the button to jump to Bookmark2, and click the second one to jump back to Bookmark1

     

     

     

     

     

    How to Get Your Question Answered Quickly 

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

    Best Regards

    Yongkang Hua

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