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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
yanzhao_LBS
Helper II
Helper II

how to keep the latest row when delete the duplicated row

when i did the remove row- remove duplicates , the earlist one will be kept,but i want to keep the latest one which is the one i need. how to achieve that?

 

yanzhao_LBS_0-1695102311401.png

 

1 ACCEPTED SOLUTION

@yanzhao_LBS 
This document explains the issue and you can download the sample from it :
https://exceleratorbi.com.au/remove-duplicates-keep-last-record-power-query/

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @yanzhao_LBS 
You need to sort in the wanted order before removing the action.

Also, you need to modify your m code to keep the sort order.

Please refer to the linked tutorial

https://www.youtube.com/watch?v=rqDdnNxSgHQ

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks for your response, but i cannot open the youtube ,can you give some doc link for the m code? as I have tried the sort,but it seems not work maybe need the 'm code ' you mentioned.

@yanzhao_LBS 
This document explains the issue and you can download the sample from it :
https://exceleratorbi.com.au/remove-duplicates-keep-last-record-power-query/

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks for your help again ,it really works for me.

Happy to help 🙂

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.