Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
SteveMcAllen
Regular Visitor

How to merge two tables with different countries, country names and country codes in Power BI?

I have a little problem in Power BI. Having the following two simplified tables, I would like to merge them in order to have population and land area of the countries listed in the first table which are also listed in the second table.

 

However, the problem is, that the country names and country codes differ in both tables, e.g., The United States/ United States of America and USA/ US. Therefore, in Power BI, when clicking on merging, I cannot choose a column which both tables have in common and inserting an index column does also not help.

 

That is, given are the following two tables:

 

Country CodePopulation 2021
AndorraAND77354
United States of AmericaUSA331893745
FranceFRA547557

 

CountryCodeLand area 2021
AndorraAD470
United StatesUS9147420
SpainES499603479


And the table I would like to produce is:

 

CountryPopulation 2021Land area 2021
Andorra 77354470
United States of America3318937459147420

 

I am new in Power BI and do not see a solution right now.

2 REPLIES 2
ddpl
Solution Sage
Solution Sage

@SteveMcAllen 

 

There is one way in power query,

 

bin14.png

 

You can merge the table by either Country or Code or both as marked in above image,

 

Tick-marked the Fuzzy Matching option...

After that add range between 0.0 to 1.0 in Similarity threshold, which is basically how many percentage you want to match the selected columns.

 

In that box you have to try different figures to get maximum matching rows.

------------------------------------------------------------------------------------------------------------------------------

 

Or you can fetch the data from public page like Wikipedia in which country names are same and you can proceed merging.

 

 

Hope this will work for you.

 

Idk how to do it

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.