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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Daniel_F
New Member

DISTINCTCOUNT - same number but different usernames

Hi all,

 

i know how to count distinct values, but in our data sometime we have same ID for different users (and this is ok) and i need to distinctcount this users like two different values, f.e.: two different persons have same ID 59566 and measure shows distinctcount result 1 but i need to see 2. Is it imposible? If yes, what should i add to my measure or maybe calculate this in other way:

 
Distinct = CALCULATE(DISTINCTCOUNT('table_name'[ID]),FILTER('table_name','table_name'[Status]=100))
 
Any suggestions? 😉
Thx in advance 😉
 
distinctcount.jpg
1 ACCEPTED SOLUTION
jcalheir
Solution Supplier
Solution Supplier

Hi

 

If your ID is not unique, i could sugest you create a Surrogate Key by concatenating the ID and the username. You can to this in either Power Query or by a Calculated Column.

 

This way you will have a unique ID and be able to count the distincts

 

Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂

View solution in original post

2 REPLIES 2
jcalheir
Solution Supplier
Solution Supplier

Hi

 

If your ID is not unique, i could sugest you create a Surrogate Key by concatenating the ID and the username. You can to this in either Power Query or by a Calculated Column.

 

This way you will have a unique ID and be able to count the distincts

 

Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂

Yes, you are right! 🙂

Thx a lot!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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