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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Hide option in slicer without filtering / don't give option to deselect / always show certain value

Hi all,

Currently I'm trying to create a visual in which one value is always shown, without having the option in a slicer to remove this value from the visual.

My dummy dataset looks like this:

LAntennaNL_0-1620585761606.png

I put ID and Value in a bar chart:

LAntennaNL_1-1620585866331.png

I add a slicer for Type:

LAntennaNL_2-1620585902517.png

I want ID = 1 to always show up in the visual, while 2 and 3 being present should depend on the slicer selection. In addition, the "Always show" option should not be visible in the slicer.

I read about the workaround to just select "Always show" and put a shape in front of it to hide it and prevent someone from deselecting it. However, the data might change, so the number of options in the slicer might as well.

Is there a solution for this?

Thanks in advance.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

I tried a solution and it worked. I created a dimension table for the Type and used it in the slicer. Untick the "'Show Value" in the visual filter. Created a measure to pass the slicer filter and added the "Show Value to it". Check the Power BI attached file below my signature.

 

M_Measure = 
CALCULATE(
    SUM(Table1[Value]),
   TREATAS(
       UNION({"Always Show"}, VALUES(dimType[Type])),
       dimType[Type]
    ) 
)

Fowmy_0-1620606010443.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
Electronique
New Member

Although this is marked as solved, I created a slicer that only showed the selections I wanted by using the Filter tab > Filter this Visual (Selecting the Slicer) > Uncheck options you don't want to see.

Fowmy
Super User
Super User

@Anonymous 

I tried a solution and it worked. I created a dimension table for the Type and used it in the slicer. Untick the "'Show Value" in the visual filter. Created a measure to pass the slicer filter and added the "Show Value to it". Check the Power BI attached file below my signature.

 

M_Measure = 
CALCULATE(
    SUM(Table1[Value]),
   TREATAS(
       UNION({"Always Show"}, VALUES(dimType[Type])),
       dimType[Type]
    ) 
)

Fowmy_0-1620606010443.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Hi @Fowmy,

Thanks a lot for your reply. I will do some testing to see if it works for my real dataset and let you know in case this is the solution for the issue I'm trying to solve.

Will keep you updated!

Thanks for your message, sure let me know after testing.

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thank you SO much for this solution. Over the past few days of searching with a similar problem, I'd been led to believe I'd have to use bookmarks, etc., but the measure is exactly what is needed. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.