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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Mr_Mr
Frequent Visitor

Remove all duplicate except first?

I've been banging my head on my desk/kitchen table as this should work but for some reason is eluding me.

 

I have two columns, first is a list of IDs and the second is a date field. Is there a way that I can sort the columns and then remove all the duplicate IDs but it keeps the most recent? So only one ID remains with the most recent date adjacent to it?

 

I have tried several ways but it keeps removing the wrong IDs.

 

Thank you in advance.

4 REPLIES 4
Ahmedx
Super User
Super User

to know how to do this watch my video

https://1drv.ms/v/s!AiUZ0Ws7G26RjAmkzSoR5Dhll_Bq?e=Nw39fj

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

Ahmedx
Super User
Super User

you can do it in power query:
1) grouping by ID
2) leave the lines where the maximum date is indicated

ERD
Community Champion
Community Champion

@Mr_Mr , it would be better if you provide some small demo table with the desired result. 

How to Get Your Question Answered Quickly 

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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