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
min-E
Helper I
Helper I

Filter/Distinct Count Help - Remove all records with same ID when one is filtered out.

Hello Community, 

Desperately need some help. Found similar requests and tested but have not reached a resolution.

 

I have the data below with 3 distinct IDs.

If I filter out records with Kiwi using a Slicer, I want to remove all rows with that ID number. So I'd be left with a count of 2 distinct IDs (records for ID 2 and 3).

 

IDItem1Item2
1applepear
1appleorange
1kiwibanana
2coconutapple
3pineappletomato

 

Thank you for your time.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @min-E 

Create a new table to get an item1 that has nothing to do with the table to use as a slicer:

Table 2 = SELECTCOLUMNS('Table','Table'[Item1])

 

vyohuamsft_1-1716536138449.png

 

Create a new measure to exclude the id value of the item selected by the slicer:

Measure = 
 VAR _ID = CALCULATE(MAX('Table'[ID]),FILTER(ALLSELECTED('Table'),'Table'[Item1]=SELECTEDVALUE('Table 2'[Item1])))
 RETURN
 IF(SELECTEDVALUE('Table'[ID])<>_ID,1)

 

Put Item1 from Table 2 into the slicer, and then put the measure into the table visual, here is my preview:

vyohuamsft_0-1716536076322.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @min-E 

Create a new table to get an item1 that has nothing to do with the table to use as a slicer:

Table 2 = SELECTCOLUMNS('Table','Table'[Item1])

 

vyohuamsft_1-1716536138449.png

 

Create a new measure to exclude the id value of the item selected by the slicer:

Measure = 
 VAR _ID = CALCULATE(MAX('Table'[ID]),FILTER(ALLSELECTED('Table'),'Table'[Item1]=SELECTEDVALUE('Table 2'[Item1])))
 RETURN
 IF(SELECTEDVALUE('Table'[ID])<>_ID,1)

 

Put Item1 from Table 2 into the slicer, and then put the measure into the table visual, here is my preview:

vyohuamsft_0-1716536076322.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

min-E
Helper I
Helper I

Just want to mention that I am using a slicer to filter records. I have a matrix with Distinct Count. 

If I filter out only the row with Kiwi, I still have the same distinct count of IDs (3). Which is why I am looking to filter all the rows for that ID.

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