Reputation: 9684
How does remove duplicates work - that is - does it keep 1st row and remove others, or does it keep the last row and remove others?
Upvotes: 0
Views: 156
Reputation: 7891
This is explained clearly in the Microsoft documentation for Table.Distinct
:
Because Power Query sometimes offloads certain operations to backend data sources (known as folding), and also sometimes optimizes queries by skipping operations that aren't strictly necessary, in general there's no guarantee which specific duplicate will be preserved. For example, you can't assume that the first row with a unique set of column values will remain, and rows further down in the table will be removed. If you want the duplicate removal to behave predictably, first buffer the table using Table.Buffer.
Upvotes: 5