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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How can I give a unique id to the patient based on the patient's name and DOB?

I am stuck at one point. I am creating a sales report for my company. for that each month I get a txt file. The size of each file is around 150mb. For that, I also have to combine old data. data for the years 2019,2020 and 2021. now the thing is, I also get patient data. now, I want to give the patient's id. Based on the patient's name and DOB. The challenge is Patient's id should only be given if that patient coming for the first time. if the patient comes again after two years, an old id should be given. One more condition; all patient information should not be included in a data model. I have to delete all columns except the patient's id. How can I do this? please help me. I am stuck at this point for while. Thank you in advance. Keep going.

 

Sample data:

name DOB
Rock12/12/1998
Rock12/12/1998
Johnson17/02/1967
Pepe24/07/1997
Pepe24/07/1997
smith11/01/1956
smith11/01/1956
smith03/06/1969
Zarna19/03/2003

 

 Data :

t_raj_0-1650620191675.png

 

End Result:

 

t_raj_1-1650620364313.png

Suppose this date is for the month of April 2021 and is given to the patient. suppose now "Rock" again comes in October 2021, the same id should be given to ROCK. In this case "1".

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Solution:

Add index to subgroups in Power Query - YouTube 

 

in my case, I have to do it a little bit differently than what is in the YT video. In this video, she gave an index to the table but in my case, I have to give an index to each group and then expand the table. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Solution:

Add index to subgroups in Power Query - YouTube 

 

in my case, I have to do it a little bit differently than what is in the YT video. In this video, she gave an index to the table but in my case, I have to give an index to each group and then expand the table. 

Vijay_A_Verma
Super User
Super User

Need to look at some sample data to work out the steps for you. 

How to Get your Question Answered Quickly - https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Kudoed Authors