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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
florent-3628
Frequent Visitor

Remove duplicate with date condition

Hi,

I'm trying to remove duplicates in a table (column "id")  ; but i want to keep only the most recent .

 

Actually , even if i sort by date before using table.distinct ; the result keep an old date...

 

the table is like this

Version     id     date

v23A02/03/2019
v23B02/04/2019
v24A05/04/2019
v24B06/04/2019
v25A24/05/2019
v25B25/05/2019

 

The actual result after table.distinct :

v23A02/03/2019
v23B02/04/2019

 

The result i want :

v25A24/05/2019
v25B25/05/2019
1 ACCEPTED SOLUTION
Anonymous
Not applicable

In Edit Queries make sure to filter descending on date. 

 

Then add 

 

    #"Buffer Table" = Table.Buffer(#"Sorted Rows")
in
    #"Buffer Table"

to the advanced editor

 

After that use remove duplicates on ID, it will remember the order and keep v25.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

In Edit Queries make sure to filter descending on date. 

 

Then add 

 

    #"Buffer Table" = Table.Buffer(#"Sorted Rows")
in
    #"Buffer Table"

to the advanced editor

 

After that use remove duplicates on ID, it will remember the order and keep v25.

Hi @Anonymous ,

 

I have the same issue but I want to do it in DAX because I want to keep only the earliest rows from a concatenate create in DAX from 2 different tables... Do you have any idea on how to remove the duplicates but only the latest ones ? 

 

Thanks 🙂 

Hi @Anonymous ,

 

I have the same issue but I want to do it in DAX because I want to keep only the earliest rows from a concatenate create in DAX from 2 different tables... Do you have any idea on how to remove the duplicates but only the latest ones ? 

 

Thanks 🙂 

Thanks a lot ; it works !

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.