Forum Discussion
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.
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).
But, instead row number 3 from first screenshot, row number 2 is removed.
Please, can someone explain me what is going on here?
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
- Anonymous6 years ago
try this
Table.Group(yourTabName, {"key"}, {{"LastDate", each List.Last(_[date])}})
2 Replies
- Pragati11Super User
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
- AnonymousNot applicable
try this
Table.Group(yourTabName, {"key"}, {{"LastDate", each List.Last(_[date])}})