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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Distinct count per values

HI Everyone

 

I cant seem to find a solution for this or rather how i could solve this using DAX.

So I have a table like this below.

How do I count the number of dogs based on he unique ID and would basically just result to 1.

 

so for ID 1 even though the dog kind appeared as 2 it should still count as 1 because of the unique ID.

 

ohraytyroo_0-1594778175349.png

Im sure its simple but i just dont know how to approach it with DAX. Thanks a lot in advance.

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You can use an expression like this

 

Dogs = CALCULATE(DISTINCTCOUNT(Table[ID]), Table[Kind] = "Dog")

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , this will make sure it is correct for all kind

 

countx(summarize(Table[ID], Table[Kind]),[ID])

 

Only for dog'calculate(distinctCOUNT(Table[ID]),Table[Kind] = "dog")

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
mahoneypat
Microsoft Employee
Microsoft Employee

You can use an expression like this

 

Dogs = CALCULATE(DISTINCTCOUNT(Table[ID]), Table[Kind] = "Dog")

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

thanks for quick reply I knew it was this simple 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.