Forum Discussion
Filter column for unique values and another column in Power Query
- 3 years ago
Hello Irwin !
You can sort in ascending order column B and then remove duplicates on column A. - 3 years ago
Hi,
It did not work. It seems this solution works in excel. However, PBI remembers the original sort and therefore cannot keep the value I want i column B once I remove duplicates.
I found a solution that work when applied to your suggestion. You need to use the table function called "Table.Buffer".https://learn.microsoft.com/en-us/powerquery-m/table-buffer
A video can be seen here.
https://www.youtube.com/watch?v=rqDdnNxSgHQ&list=PLDz00l_jz6zzttb28XH8GHZNL6vvpBlkQ&index=23
Hi,
It did not work. It seems this solution works in excel. However, PBI remembers the original sort and therefore cannot keep the value I want i column B once I remove duplicates.
I found a solution that work when applied to your suggestion. You need to use the table function called "Table.Buffer".
https://learn.microsoft.com/en-us/powerquery-m/table-buffer
A video can be seen here.
https://www.youtube.com/watch?v=rqDdnNxSgHQ&list=PLDz00l_jz6zzttb28XH8GHZNL6vvpBlkQ&index=23
The first comment on that video link provided a very easy solution I think.
1) Sort as needed. (Sort Column B Ascending here)
2) Create Index column (*magic step*, will override original index during existence)
3) Select Column A. Use Remove Duplicate rows. (will keep the first instance of each)
4) Remove index column. (if desired)
5) Sort by Column A or whatever you wish.