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

Force selection and max limit of selections in Power BI Slicer

Hi All,

 

Need your help here.

 

Can we set the Force selection and Max number of selections in Power BI Slicer.

If No, is there any custom visual, which can provide both functionalities.

 

Many thanks.

3 REPLIES 3
itsmebvk
Continued Contributor
Continued Contributor

@Anonymous you can try forced selection using "ChicletSlicer" visual, go to https://app.powerbi.com/visuals/ and download "ChicletSlicer" visual. Once you download it select visualisation under settings change Forced option to On 

 

Capture.PNG

 

 

As far as I know there is no such direct option to restrict slicer values selection. Alternatively based on the count of selected values in slicer you show or hide some warning message to user saying that they have selected more values than the allowed slicers values.

Anonymous
Not applicable

Hi @itsmebvk

Many thanks for your reply.

 

I need both the features 1. Force Selection 2. Max. limit of selecion in one visual. Your idea is good to add warning messages. I can try with that. Would be grateful, if you can tell me how we can set up the warning msgs in Power BI.

 

Thanks again.

itsmebvk
Continued Contributor
Continued Contributor

@Anonymous Please follow below steps

 

1)Create a table report with desired columns

2)Create a slicer on desired columns

3)Create a measure "Selected Count"using following code 

 

Selected Count = if(ISFILTERED(Sheet1[Color]),CALCULATE(SUMX(VALUES(Sheet1[Color]),1)),0)

4)Create one more measure "Message" using following code 

Message = if([Selected Count]>5,"Please Select Only 5 Values"," ") & if([Selected Count]=0,"Please Select A Values"," ")

5)Add Message column to a new table, hide header of the table and borders

 

Now when you select more that 5 values in slicer it will display warning message, I have also added optional message when nothing is selected in slicer. PFA PBIX for your reference.

 

Please mark post as resloved this solution helps.

 

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.