Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
I've got this table with duplicates, but when I add the "remove duplicates" step in Power Query, it removes the wrong rows.
Here's an example of the table:
Pay attention to xyz10005 and xyz10016.
I need Power BI to select the lowest status.
But the remove duplicate selects the rows that have a higher status.
After removal:
as you can see above, the wrong rows have been selected to keep.
Can anybody help me out on this one?
With kind regards,
Lazzanova
Hi @Anonymous,
If you want you will always have the lowest value, you should group maia.Persoon.cd_relatie by minimum Count value. You can do it with this formula:
= Table.Group(#"Changed Type", {"maia.Persoon.cd_relatie"}, {{"Count", each List.Max([Status]), type nullable number}})
And you would have always the minimum value.
I hope this solve your question!
The problem is that the table has other columns as well:
And 30 other columns as well...
Ok, so you have two options:
First one, you sort the status column in ascending order, so if you remove duplicate in maia.Persoon.cd_rate you would keep the minimum values of status,
Second option, you can create a key column, then duplicate the table to keep the key column and the two columns we had (maia.Persoon.cd_relatie and status), and then group by minimum value and combine this table with the other table by the key column.
If you have problems tell me @LaZZaNoVa-61
The first option is what I've done, but it is not working.
The second option is something I have not tried out yet.
Check out the July 2025 Power BI update to learn about new features.