Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am looking to filter reports based on a list of Staff Members chosen from a slicer. I want to show which values are selected in a card.
If one value is selected, return its value (Staff Name). If none explicitly selected, return "All Selected". If more than one, show "N Selected" where N is the number of boxes checked.
The following code works in the first 2 scenarios, but when multiple items are selected it returns "All Selected":
Slicer Selected Measure =
VAR selected = SELECTEDVALUE(Staff_Details[Staff Member])
RETURN IF (
ISBLANK(selected),
"No Staff Member Selected",
IF (
DISTINCTCOUNT(Staff_Details[Staff Member]) = 1,
selected,
CONCATENATE(DISTINCTCOUNT(Staff_Details[Staff Member]), " Staff Members Selected")
)
)
How to fix this so that it returns the values as required?
Solved! Go to Solution.
Measure =
VAR SelectedMember =
COUNTROWS ( VALUES ( Staff_Details[Staff Member] ) )
VAR All_Members =
COUNTROWS ( ALL ( Staff_Details[Staff Member] ) )
VAR Result =
SWITCH (
TRUE(),
All_Members = SelectedMember, "All Selected",
SelectedMember = 0, "No Member Selected",
SelectedMember = 1, SELECTEDVALUE ( Staff_Details[Staff Member] ),
SelectedMember > 1, SelectedMember & " Staff members Selected"
)
RETURN Result
Perfect - works a treat!
Measure =
VAR SelectedMember =
COUNTROWS ( VALUES ( Staff_Details[Staff Member] ) )
VAR All_Members =
COUNTROWS ( ALL ( Staff_Details[Staff Member] ) )
VAR Result =
SWITCH (
TRUE(),
All_Members = SelectedMember, "All Selected",
SelectedMember = 0, "No Member Selected",
SelectedMember = 1, SELECTEDVALUE ( Staff_Details[Staff Member] ),
SelectedMember > 1, SelectedMember & " Staff members Selected"
)
RETURN Result
Hi Anriksh
I've now extended this logic to multiple slicers interacting on the same table (Staff Details). Unfortunately this breaks the intended logic of the solution - if for example Staff Member John is explicitly selected, the corresponding Measure for Staff Team goes from All Selected to "1 Team Selected" because the rows in the filtered table are filtered from the whole.
What I am looking for is a measure that shows only the Slicers where a value has been explicitly chosen - even if the team is implicitly selected by the application of the Staff Member filter. Is there a way to do this that returns the results of the Checked values in the slicer itself ,as opposed to a measure based on the filtered table rows?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
10 | |
10 | |
9 | |
7 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |