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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AlexW24
New Member

Distinct with multiselect slicer

How can I update the following to allow multiple selected values in a slicer?

 

Distinct Apps = 
CALCULATE(
    DISTINCTCOUNT(AppUsage[AppName]), 
    FILTER(
        AppUsage, 
        AppUsage[UserName] <> SELECTEDVALUE(DeveloperTable[UserName]
        )
    )
)

 

I have a report that shows app useage data.  The visuals show the apps and the number of users that access each app.  There is a slicer that has the names of developers and when I select a developer, the visuals updates and removes any app userage data with that developer's name.  There is also a card that uses the measure I posted above that shows the distict number of apps.  The measure works when selecting one developer at a time, but how do I get it to work with multiple selected developers?

1 ACCEPTED SOLUTION
tayloramy
Community Champion
Community Champion

Hi ,  

You’re running into a classic SELECTEDVALUE limitation: it only returns a single value. With multiple developers selected, SELECTEDVALUE goes blank, so your filter logic no longer excludes the chosen names. 

Use the IN operator against the selected list, and guard for the “no selection” case so you don’t exclude everyone by accident:

Distinct Apps =
VAR HasDevFilter =
ISFILTERED(DeveloperTable[UserName])
VAR SelectedDevs =
VALUES(DeveloperTable[UserName]) -- all developers currently selected in the slicer
RETURN
IF (
NOT HasDevFilter, -- nothing selected: show all apps (no exclusions)
DISTINCTCOUNT ( AppUsage[AppName] ),
CALCULATE (
DISTINCTCOUNT ( AppUsage[AppName] ),
REMOVEFILTERS ( DeveloperTable[UserName] ), -- ignore slicer’s direct filter first
NOT ( AppUsage[UserName] IN SelectedDevs ) -- then exclude selected developers
)
)

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution. 

@AlexW24

View solution in original post

3 REPLIES 3
v-saisrao-msft
Community Support
Community Support

Hi @AlexW24,

Thank you @tayloramy, for your insights.

I've reproduced the issue and received the following output. I've also attached the pbix file for your reference.

vsaisraomsft_0-1758616692732.png

Hope this helps

 

Thank you.

tayloramy
Community Champion
Community Champion

Hi ,  

You’re running into a classic SELECTEDVALUE limitation: it only returns a single value. With multiple developers selected, SELECTEDVALUE goes blank, so your filter logic no longer excludes the chosen names. 

Use the IN operator against the selected list, and guard for the “no selection” case so you don’t exclude everyone by accident:

Distinct Apps =
VAR HasDevFilter =
ISFILTERED(DeveloperTable[UserName])
VAR SelectedDevs =
VALUES(DeveloperTable[UserName]) -- all developers currently selected in the slicer
RETURN
IF (
NOT HasDevFilter, -- nothing selected: show all apps (no exclusions)
DISTINCTCOUNT ( AppUsage[AppName] ),
CALCULATE (
DISTINCTCOUNT ( AppUsage[AppName] ),
REMOVEFILTERS ( DeveloperTable[UserName] ), -- ignore slicer’s direct filter first
NOT ( AppUsage[UserName] IN SelectedDevs ) -- then exclude selected developers
)
)

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution. 

@AlexW24

@tayloramy Thank you for the solution!  Prior to coming here for help, I did try to make it work with the "IN" function but I was nowhere close to what you provided.  This seems like an overly complicated formula just to allow multiple selected items.  I hope Microsoft makes this easier in the future.  

 

Thanks again for the solution!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.