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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jharris32
Frequent Visitor

Distinct Count of Individuals using Date of Birth as a criteria

Hi!
I need a distinct count of individuals in a dataset, but would like to use the individuals date of birth as criteria since there will be people in our list with the same name but a different date of birth. So essentially a distinct count using the individuals name AND date of birth to determine whether it is truly a unique individual. Any suggestions?

1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

Hi @jharris32 ,
@bhanu_gautam good reply! 
Here is another way to achieve this. 

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1708419825127.png
1.Open power query and right click the table and choose Duplicate, in table(2), group by columns

vheqmsft_1-1708420082431.png

vheqmsft_2-1708420131365.png

2.Close and apply, create a meure

DISTINCT COUNT BY NAME AND BIRTH = COUNT('Table (2)'[Count])

3.Final output

vheqmsft_3-1708420320554.png

 

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 



View solution in original post

4 REPLIES 4
v-heq-msft
Community Support
Community Support

Hi @jharris32 ,
@bhanu_gautam good reply! 
Here is another way to achieve this. 

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1708419825127.png
1.Open power query and right click the table and choose Duplicate, in table(2), group by columns

vheqmsft_1-1708420082431.png

vheqmsft_2-1708420131365.png

2.Close and apply, create a meure

DISTINCT COUNT BY NAME AND BIRTH = COUNT('Table (2)'[Count])

3.Final output

vheqmsft_3-1708420320554.png

 

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 



Hi @v-heq-msft , thank you - this is helpful!! If I think wanted to further narrow things down by another variable (so first getting a distinct count based on age/dob, then taking that first distinct list and narrowing down with street address), would that be possible? Or can I only use one metric?

 

 

Thanks!

Hi @jharris32 ,
Thank you for your reply, if you want to limit the scope of the search by another indicator, you can do so by adding another column in the first step. Of course, if you want to go for limiting in the altered table (i.e. Table(2) above), you can also do it via distinctcount.

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

bhanu_gautam
Super User
Super User

@jharris32 , You can create one calculated column concatenating DOB and name using below method

 

UniqueIdentifier = CONCATENATE([Name], "-", FORMAT([DateOfBirth], "YYYY-MM-DD"))

 

And from this column you can create a measure for Distinct value

 

UniqueIndividualsCount = DISTINCTCOUNT('YourTableName'[UniqueIdentifier])

 

Please accept as solution and give kudos if it helps





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.