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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.