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
dlopesc04
Advocate I
Advocate I

How to lock items in a slicer

So, I'll quickly explain the issue and what I need: There is a clomun in my database which I've inserted as a Data Slicer in my report, so the user can filter out and focus wherever they want.
The problem is: There are about 80 values they can filter from, and whenever they filter it, all the other 79 are excluded. Now this is fine for most of my report, but there are 6 of those 80 values that, if filtered out, break one of my visuals.
What I want/need: Somehow lock these 6 values, making users unable to filter them out from the slicer, but still allow them to "mess around" with the other 74. Is there a Way to do it?

1 ACCEPTED SOLUTION

Hi @dlopesc04 ,

 

As far as I know, Power BI doesn't support us to lock selections in slicer.

I think you can try to create an unrelated table with data from column and create a slicer by this column. Then create a measure to filter the visual.

My sample:

RicoZhou_0-1653386406979.png

In my sample, I need my visual always show values A,B,C,D,E,F and other selected values from slicer.

Measure = 
VAR _DETERMIND_LIST = {"A","B","C","D","E","F"}
VAR _SELECTION = VALUES(Selection[Column1])
RETURN
IF(ISFILTERED(Selection[Column1]), IF(MAX('Table'[Column1]) in _SELECTION ||MAX('Table'[Column1]) in _DETERMIND_LIST,1,0),IF(MAX('Table'[Column1]) in _DETERMIND_LIST,1,0))

Add this measure into visual level filter and set it to show items when value =1. Result is as below.

By default:

RicoZhou_1-1653386463248.png

Select "H"

RicoZhou_2-1653386495824.png

 

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
amitchandak
Super User
Super User

I use many of those, What I wish is to always have 6 items filtered *IN*
EX: when someone clicks on an item, I want that item plus the other six to filter the page, instead of only that item filtering the page.

Hi @dlopesc04 ,

 

As far as I know, Power BI doesn't support us to lock selections in slicer.

I think you can try to create an unrelated table with data from column and create a slicer by this column. Then create a measure to filter the visual.

My sample:

RicoZhou_0-1653386406979.png

In my sample, I need my visual always show values A,B,C,D,E,F and other selected values from slicer.

Measure = 
VAR _DETERMIND_LIST = {"A","B","C","D","E","F"}
VAR _SELECTION = VALUES(Selection[Column1])
RETURN
IF(ISFILTERED(Selection[Column1]), IF(MAX('Table'[Column1]) in _SELECTION ||MAX('Table'[Column1]) in _DETERMIND_LIST,1,0),IF(MAX('Table'[Column1]) in _DETERMIND_LIST,1,0))

Add this measure into visual level filter and set it to show items when value =1. Result is as below.

By default:

RicoZhou_1-1653386463248.png

Select "H"

RicoZhou_2-1653386495824.png

 

 

Best Regards,
Rico Zhou

 

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

Hello @v-rzhou-msft 
Thank you for your great answer! I've managed to get it to work, but there's a problem, since the table with the values is unrelated I can only filter the visual with the measure as a filter, and unfortunately it doesn't interact with the other visuals in my report. When I insert the measure as a filter in the other visuals it just breaks everything, since some of my chart's values are actually measures themselves). Is there a way to achieve what you have done while still filtering the rest of the pagel like the normal "Column1" would do?
I've left a link to a pbix file, there are three slicers and the first one is the exact same you came up with, the other two actually filter the whole page but they don't work like the first one. (second slicer is an excel file which has a table identical to just using VALUES('Table'[Column1]), Third slicer is just the "Column1" of my main database)

If, given time, I still can't find a true solution, I'll mark your answer as it, since it satisfies what is asked in the post.

File: https://drive.google.com/file/d/1stjflphtj2GssZz9rANOP9QFO-TFZ4Kq/view?usp=sharing 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.