Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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:
I put ID and Value in a bar chart:
I add a slicer for Type:
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.
Solved! Go to Solution.
@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]
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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.
@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]
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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.
⭕ 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.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |