Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a table called Country and it has following data
| CountryKey | Country Name |
| 1 | Australia |
| 1 | Aus |
| 2 | United States |
| 2 | USA |
| 3 | Canada |
| 3 | Can |
and want convert data like:
| CountryKey | Country Name |
| 1 | Australia |
| 2 | United States |
| 3 | Canada |
Which function should you use in the query for Country Table:
Table.RemoveMatchingRows
Table.Distinct [Is this right]
Table.InDistinct
Table.ReplaceMatchingRows
https://docs.microsoft.com/en-gb/powerquery-m/table-distinct
I tried: Edit Queries-->Select your table-->Select Column-->Right Click-->Remove Duplicates--> then go to Advance Editor--> and found that #"Removed Duplicates" = Table.Distinct(#"Changed Type", {"CountryKey"})
Solved! Go to Solution.
Hi @Anonymous ,
Based on my test, the Table.Distinct is right.
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case.
Best regards
Amy Cai
Hi @Anonymous ,
Based on my test, the Table.Distinct is right.
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |