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
Anonymous
Not applicable

When selecting one slicer, other slicer gets disabled

Hi All,

Need your help in this.

We have two independent slicers in our report.

The requirement is : if user selects select one value from slicer A then he can't select anything from Slicer B and vice versa. The output should be either according to slicer A or B, not both. 

These two are not the hierarchical columns. Not sure if we can achieve this.

Any idea?

 

Thanks

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Anonymous 

 

Since we can now apply visual level filters to slicers, you could create a measure to check whether Attribute A is filtered, and if so, exclude all items from the slicer on Attribute B, and similarly for the reverse.

 

See the attached PBIX for a simple example.

 

I have Attribute A & Attribute B as separate dimension tablesData modelData model

 

and the following measures:

 

A is filtered = 
INT ( ISFILTERED ( 'Attribute A'[Attribute A] ) )

B is filtered = 
INT ( ISFILTERED ( 'Attribute B'[Attribute B] ) )

 

 

Then place a visual level filter on the Attribute A slicer set to B is filtered is not 1, and the reverse for the other slicer.

Then when a selection is made on one slicer, the options on the other slicer disappear.Item on Slicer A selectedItem on Slicer A selected

 

Item on Slicer B selectedItem on Slicer B selected

 

 

Hopefully this can be adapted to your situation 🙂

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

11 REPLIES 11
OwenAuger
Super User
Super User

Hi @Anonymous 

 

Since we can now apply visual level filters to slicers, you could create a measure to check whether Attribute A is filtered, and if so, exclude all items from the slicer on Attribute B, and similarly for the reverse.

 

See the attached PBIX for a simple example.

 

I have Attribute A & Attribute B as separate dimension tablesData modelData model

 

and the following measures:

 

A is filtered = 
INT ( ISFILTERED ( 'Attribute A'[Attribute A] ) )

B is filtered = 
INT ( ISFILTERED ( 'Attribute B'[Attribute B] ) )

 

 

Then place a visual level filter on the Attribute A slicer set to B is filtered is not 1, and the reverse for the other slicer.

Then when a selection is made on one slicer, the options on the other slicer disappear.Item on Slicer A selectedItem on Slicer A selected

 

Item on Slicer B selectedItem on Slicer B selected

 

 

Hopefully this can be adapted to your situation 🙂

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Came across this as it's something I am trying to do as well but I have 3 slicers at play. Did you put the measures into one table (attribute A) or put each measure in it's corresponding table? I can't seem to get it to work. My thinking is the values in the attributes must be numbers? I have them as text. How would I accomplish this with text slicers?

Hi @agalbraith 

The 2 slicer example can be extended to 3 or more slicers. Example attached 🙂

 

You would need to:

  1. Create an "is filtered" measure corresponding to the column used in each slicer.
  2. For each slicer, add visual-level filters for every other slicer's measure.

It doesn't matter which table the measures are in, and it shouldn't matter whether they are text or numbers. The example attached uses text.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

I am working on the same problem and for some reason it doesn't seem to working.

Okay I got it to work! Thanks so much!!

Thanks Owen! I think I can figure it out. For some reason it's not letting me set it as "many to one" from my main table to the attribute tables I created. Keeps saying it has to be many to many so I am going to continue trying. I think I have to make a separate table with just the slicer info and an ID.

Hello, firstly very good solution that you made, I solved the problem I had.
But I had a question, how do you create a slicer of that style, I have tried everything but nothing comes out the same.
Also, how do you change the color when it is selected, since my company has institutional colors and I would like to use these, but nowhere I can find where to change these colors.

 

When the button is not selected: 

Ivancito111_0-1634049983493.png

I changed these colors and they are fine

 

When the button is selected:

 

Ivancito111_1-1634050046649.png 

I can't find where to change these colors.

 

When I hold the mouse over the button:

Ivancito111_2-1634050138077.png

I can't find where to change these colors.

 

If you have any guide on how to modify this kind of buttons it would be very helpful, but any kind of information would be very helpful.

 

Greetings

 

Hi @Ivancito111 

First off, to make a built-in slicer appear with "buttons", in the Format pane, General > Orientation > Horizontal.

However, the built-in slicer hover/selected colours cannot be customized. The Chiclet Slicer (free custom visual) does have those options however, so I suggest you try that.

 

Kind regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

First of all, thank you very much, both for the answer and for the solution.
But I wanted to know if it is possible that instead of the button disappearing, it can change color or darken and not allow clicking it.
I was asked this question at work but I don't know how to answer it.

Greetings and thank you very much.

 

@Ivancito111 you're welcome.

For your last question, do you mean, on a slicer, you want to "disable" values that are not available but still have them visible, but formatted differently?

This is not possible as far as I know...but someone else might have an idea.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
Anonymous
Not applicable

Hi @OwenAuger 

Many thanks for your reply.

It worked beautifully.

Thanks again.

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.