Forum Discussion

Kimber's avatar
Kimber
Icon for Helper III rankHelper III
2 years ago
Solved

Can a button clear a single filter?

When a user selects a data point, I would like to show a button that indicates the filter being used. When the button is clicked, the filter would be removed and the button would disappear. The image below shows what I'm trying to accomplish. Is this possible? I know I can use a bookmark to clear all filters, but I want to be able to clear them one at a time.

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Kimber ,

    Bookmarks are a transient state in Power BI Desktop and we can use bookmarks to store the state we need. Single deselection can optionally be linked with a button and a bookmark, so that a single deselected transient state can be realized. I think you can check this documentation on bookmarks: Create report bookmarks in Power BI to share insights and build stories - Power BI | Microsoft Learn

     

     

     

    Best Regards

    Yilong Zhou

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

     

     

6 Replies

  • Hi Kimber, you can achieve it by using a measure. In the measure you capture filter values and then display the measure in a text box. See example below:

    Label Filter Column1= 
        IF(
            NOT( ISFILTERED('Table'[Column1]) ),     //if nothing is selected
            "All",                                   //then show this (you can replace it with blank)
            CONCATENATEX(                            //otherwise (so the column is filtered)
                VALUES( 'Table'[Column1) ),          //get current values
                [Column1],                           //access the temporary column with the data
                ", "                                 //concatenate values from above (makes sence if you have few values) using "," delimiter 
            )
        )

    You can create multiple measures or combine multiple values within the same measure (as you preffer 🙂 )

    • Kimber's avatar
      Kimber
      Icon for Helper III rankHelper III

      Thank you, Sergii24 ,.Your method will show a text box containing the filters selected, but I'm looking to create a button for each selected filter which I can then click to DESELECT the filter. Like in the image I posted.

      • Sergii24's avatar
        Sergii24
        Icon for Super User rankSuper User

        Hi Kimber, thanks for the reply. You can only apply on of the selected actions to a button:

        Therefore, there is no way to remove a single filter, only all of them. Single deselction should happen through a bookmark.

        Have a great day!