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
Wauv... this is a very simple solution and weirdly enough I think it might actually work. I will play around with it and see if there is no errors.
Thank you.
I already used it sometimes and I think it doesn't make any errors. However, if it happens in your case please let me know 😁
- Irwin3 years ago
Helper IV
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- Phoen1x093 years agoFrequent Visitor
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.