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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
dmswimtrk2
New Member

Count distinct values based on items NOT SELECTED in slicer

I've officially run into a loop with Chat GPT on this issue!

 

I am trying to create a matrix visual in PowerBI that counts the distinct IDs based on age grouping for values that ARE NOT SELECTED in a filter. 

 

Here is an example of my table:

dmswimtrk2_0-1700083094022.png

 

Here is an example of the output:

dmswimtrk2_1-1700083120005.png

 

The closest I've gotten is using this formula:

DistinctIDs_NotSelected = CALCULATE( DISTINCTCOUNT(Data_Labels[id]), NOT(Data_Labels[PRODUCT CURRENT USE] IN VALUES(Data_Labels[PRODUCT CURRENT USE])) )

 

HOWEVER, the problem with this formula is that it doesn't recognize IDs that do have a product selected, but have other products associated with it. Using the example table above and assuming my slicer has Product 1 selected, this formula will count id #4 in both the selected and not selected counts because PowerBI doesn't know that rows 3 in 4 in the example table are associated with row 2. How do I adjust the formula or create a new column so that it searches the table for an id and assigns all rows of the id to true if the slicer shows the selected product (and false if it doesn't)?

1 REPLY 1
amitchandak
Super User
Super User

@dmswimtrk2 , You need slicer on  independent/disconnected table

 

Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors