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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
uc
Helper II
Helper II

Removing duplicates

Hello

 

Below is the sample excel table where I want to remove the duplicates

 

uc_0-1643555284577.png

 

Tried to remove duplicates in Power BI, sorting by ID and DOB and used Max function for each field. The snapshot of the result is as below

 

uc_1-1643555507401.png

 

You can see that ID 1 has two parents and the DOB of CC is not correct.

You can see that when there are 2 different parent details for an ID then it is not working properly.

 

I want the data be like the one below (ie. only one parent detail (with maximum data filled in) tied against each ID). Is this possible to achieve in Power BI? Any help is much appreciated. Thanks

 

uc_0-1643561027822.png

 

 

1 ACCEPTED SOLUTION
ToddChitt
Super User
Super User

Looks like you have a data quality problem. One person cannot have two mothers, last I checked. 

When you have duplicates like this, who is to day one Mother's Firstname is right or wrong? Based on the fact that one row has DOB and one not?

 

Try this: On DOB column, replace NULL with some real early date, like 1/1/1930. Now DUPLICATE the dataset (don't reference). Aggregate that by ID, and take MAX(DOB). Now JOIN that to the original dataset, and join on ID and DOB, with INNER JOIN. Lastly, replace 1/1/1930 with NULL.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
ToddChitt
Super User
Super User

Feel free to mark replies as "Accepted Solution" if appropriate.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





ToddChitt
Super User
Super User

Looks like you have a data quality problem. One person cannot have two mothers, last I checked. 

When you have duplicates like this, who is to day one Mother's Firstname is right or wrong? Based on the fact that one row has DOB and one not?

 

Try this: On DOB column, replace NULL with some real early date, like 1/1/1930. Now DUPLICATE the dataset (don't reference). Aggregate that by ID, and take MAX(DOB). Now JOIN that to the original dataset, and join on ID and DOB, with INNER JOIN. Lastly, replace 1/1/1930 with NULL.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Thankyou!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors