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
Bastienlin_
Helper II
Helper II

How to force the selection of a Slicer and only let the user select what is not forced

Hello,

 

I'd like to know if you know of a way to force the selection of a filter, while leaving the freedom to select another element.

Here's an example to illustrate my point:

I'd like to be able to force the selection of entities A and B in all the visuals on my page, while leaving the user free to select any entity C, D, E etc..

The aim is to leave the user only the option of selecting entities other than A and B, and thus hide them from the Slicer.

 

The image below shows an example of what the user should see if he selects entity C.

Bastienlin__0-1711461138780.png

Note that we have a lot of different entities

 

Thank you for your help !

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Bastienlin_ ,

I created some data:

vyangliumsft_0-1711512851428.png

 

 

Here are the steps you can follow:

1. Create calculated table -- slicer.

Table 2 =
DISTINCT('Table'[entity])

vyangliumsft_1-1711512851430.png

2. Create measure.

Flag =
var _select=SELECTCOLUMNS('Table 2',"select",'Table 2'[entity])
return
IF(
    MAX('Table'[entity]) in _select || MAX('Table'[entity]) in {"A","B"},1,0)

3. Place [FLag] in each visual filter that needs to be forced to display.

vyangliumsft_2-1711512875224.png

4. Result:

vyangliumsft_3-1711512875224.png

 

 

Best Regards,

Liu Yang

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

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Bastienlin_ ,

I created some data:

vyangliumsft_0-1711512851428.png

 

 

Here are the steps you can follow:

1. Create calculated table -- slicer.

Table 2 =
DISTINCT('Table'[entity])

vyangliumsft_1-1711512851430.png

2. Create measure.

Flag =
var _select=SELECTCOLUMNS('Table 2',"select",'Table 2'[entity])
return
IF(
    MAX('Table'[entity]) in _select || MAX('Table'[entity]) in {"A","B"},1,0)

3. Place [FLag] in each visual filter that needs to be forced to display.

vyangliumsft_2-1711512875224.png

4. Result:

vyangliumsft_3-1711512875224.png

 

 

Best Regards,

Liu Yang

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

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.