Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Ethanhunt123
Helper III
Helper III

Create slicer Yes / No to filter the grid.

Hello, I have a slicer that shows various colour (Red, Blue, Green). I have a grid that shows details for fruits (name, color, size, taste etc). I want to create a slicer with Yes/ No option for the user, If the user selects "yes" then filter the grid with colour slicer if the user selects "no" then do not filter the grid with colour slicer (show all colour in the grid, irrespective of the selection in the colour slicer). Just like the sync capability but with dynamic Yes/no.

7 REPLIES 7
v-deddai1-msft
Community Support
Community Support

Hi @Ethanhunt123 ,

 

It seems that you need button to clear slicer selections in your report. As mentioned by MFelix, you can realize it by using button and bookmark. I suggest you follow the detailed steps in https://radacad.com/clear-all-slicers-in-power-bi-a-bookmark-story

 

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

 

Best Regards,

Dedmon Dai

MFelix
Super User
Super User

Hi @Ethanhunt123 ,

 

You need to create a disconnected table with Yes/No and another one with the colours then add the following measures:

 

Filter Table =
SWITCH (
    TRUE ();
    SELECTEDVALUE ( Apply_Filter[Yes/No] ) = "No"; 1;
    SELECTEDVALUE ( Apply_Filter[Yes/No] ) = "YES"
        && SELECTEDVALUE ( 'Table'[Colour] ) IN VALUES ( Colour_Slicer[Colour] ); 1;
    BLANK ()
)

Now filter the visualization based on values equal to 1.

 

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix  That slicer for color is on the main (setup page) that is affecting many other tabs in the report. I cannot use disconnected table slicer. It will not filter data for anything

Hi @Ethanhunt123 ,

 

Did not realized you add that limitation. Since it's based on that slicer maybe the best option is to create two similar tables one with the interactions with the slicer and another without then create two bookmarks and associate them to a Yes / No buttons and that will present one table or another one.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix  I cannot create a bookmark that tab already has a bookmark. 

Hi @Ethanhunt123

You can create multiple bookmarks there is no issue on having multiple bookmarks on the same page.

I have a report with only a single page but I give 10 different reports pages just using bookmarks. 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



amitchandak
Super User
Super User

@Ethanhunt123 , isfiltered or has one value should help

 

example

if(isfiltered(YesNo[YesNo]), [Measure], calculate([Measure], all(Table[color]))

 

if(isfiltered(YesNo[YesNo]), [Measure], calculate([Measure], removefilters(Table[color]))

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

 

https://docs.microsoft.com/en-us/dax/removefilters-function-dax

Helpful resources

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