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

Join 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.

Reply
Anonymous
Not applicable

Getting Distinct Count for only certain values based on values in another column

Hello all,

 

I have a table that looks something along the lines of this:

 

ID                Status Number

100                        1

100                        2

100                        1

101                        1

101                        6

101                        2

101                        1

105                        2

105                        2

203                        7

203                        1

323                        5

323                        1

445                        5

445                        2

489                        1

512                        2

 

What I want to do is create a measure that counts the number of distinct IDs that have at least 1 value that is not equal to 2, 5, or 7. So the output for this small table would be 5 since it would count 100, 101, 203, 323 and 489. It would not count 105, 445, or 512 since the only values that it has are 2, 5, or 7.

 

Thank you in advance for the help

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hello @Anonymous 

Here is a measure that should do what you want:

Distinct IDs Status not 2,5,7 =
CALCULATE (
    DISTINCTCOUNT ( YourTable[ID] ),
    NOT YourTable[Status Number] IN { 2, 5, 7 }
)

Does that work for you?

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hello @Anonymous 

Here is a measure that should do what you want:

Distinct IDs Status not 2,5,7 =
CALCULATE (
    DISTINCTCOUNT ( YourTable[ID] ),
    NOT YourTable[Status Number] IN { 2, 5, 7 }
)

Does that work for you?

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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