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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
RyanHare92
Helper I
Helper I

DISTINCTCOUNT based on measure

I have the following dataset:

 

RyanHare92_7-1675775468140.png

 

and the following measures:

Count of Filters = if(ISFILTERED(Table1[Product]), COUNTROWS(FILTERS (Table1[Product])), 0)

Count = if(ISFILTERED(Table1[Product]), COUNT(Table1[Unique_ID]),0)

What I would like to to is, when I filter the table at Product, that a measure disctinct counts the unique_ID that have a count equivalent to the count of filters.

The following should be able to explain better:

When filtering to product 1, A list of all appear, because they all have product 1: 

 

RyanHare92_6-1675775456690.png

 

 

But when also selecting Product 2, A and B have a total count of 2 because they have entries for both product 1 and 2.

 

RyanHare92_5-1675775442514.png

 

 

Now, what I ultimately want, is a measure that can do a distinctcount on only the Unique_ID that have the Count equal the count of filters. In the above scenario, I would want the total to give me 2 (as only UNIQUE_ID A and B have both products 1 and 2).

I have put together the following:

Total = CALCULATE(DISTINCTCOUNT(Table1[Unique_ID]),FILTER(Table1, Table1[Count]=Table1[Count of Filters]))

but this doesn't seem to work. I understand why it's not working, but I can't seem to figure out how to put together a measure to calculate this for me.

Many thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@RyanHare92 , I think you need what I explained here

And for Selected Values, All selected values are present: https://youtu.be/X5T4rIZovHk

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@RyanHare92 , I think you need what I explained here

And for Selected Values, All selected values are present: https://youtu.be/X5T4rIZovHk

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

That was exactly what I needed. Worked like a charm! Thank you so much,  @amitchandak !

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.