cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Removing duplicates after sorting does not work as expected

So I have key column and a date column and i am trying to keep only last date for every key. I first sort by key column and then by date column descending, and everything is looking fine. But when I click on remove duplicates, it does not remove rows that I wanted to remove, for some keys it remove wrong rows.

sort.png

Here is screenshot of table, after sorting, everything seems fine. I marked rows that are expected to be removed after I click on remove duplicates(based on key column).

sort1.png

But, instead row number 3 from first screenshot, row number 2 is removed.

Please, can someone explain me what is going on here?

2 REPLIES 2
Highlighted
Community Champion
Community Champion

Re: Removing duplicates after sorting does not work as expected

HI @NenadV ,

 

There is an existing thread for this. Chek this if it helps:

https://community.powerbi.com/t5/Desktop/Keep-only-the-latest-date-for-duplicate-entries/td-p/638447

 

Thanks,

Pragati



Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂
Highlighted
Responsive Resident
Responsive Resident

Re: Removing duplicates after sorting does not work as expected

 

 

try this

 

Table.Group(yourTabName, {"key"}, {{"LastDate", each List.Last(_[date])}})

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!