Reply
yanzhao_LBS
Helper II
Helper II
Partially syndicated - Outbound

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

 

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Syndicated - Outbound

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

View solution in original post

Syndicated - Outbound

@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

Syndicated - Outbound

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

Syndicated - Outbound

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.

Syndicated - Outbound

@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

Syndicated - Outbound

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

Syndicated - Outbound

Happy to help 🙂

 

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

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)