Forum Discussion
Remove duplicates, keep the latest entry (Sharepoint as source)
- 5 years ago
Hi! Thanks for taking time. I have resolved the issue by sorting descendingly the RunDate then partition by Reservation No. - add index column, expand the partition table and remove its duplicates.
Hi hmenco ,
not sure if this would be faster, but it might be worth a try:
Group by reservation and cust no and add 2 fields:
max Rundate and All
Expand All and filter Rundate = MaxRundate
Although the grouping operation will cost performance, no need to sort and buffer.
lbendlin ,
the sort order you've described is not guaranteed to stick:
Bug warning for Table.Sort and removing duplicates... - Microsoft Power BI Community
- lbendlin5 years agoSuper User
ImkeF thank you for the warning. Since this is a SharePoint source I assume no query folding is happening and the sort is safe-ish?
- ImkeF5 years agoCommunity Champion
Hi lbendlin ,
no, that's not how I understood the thread:
.." or because when run locally it may constraint the operators in some ways that would make the operation inefficient or impossible to enforce.."
To me this means that even locally evaluated queries won't have a guaranteed sort order.