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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
utsavpatel
Employee
Employee

Country Code to Country Name

I have a column called Country (US,IN) with 2 letter country code and what I need is another column that has country name in it. I prefer Powerbi inbuilt functionality rather than downloading a new mapping code to name file from open source.

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

Hi @utsavpatel ,

 

There is no in-built functionality in Power BI that by-default creates a column with country name for you against these country codes.

  1. You can create a calculated column which assigns a country name value against these country codes. But this may not be appropriate as you may have multiple country codes in your data. If there are like just for example 5 country codes then you can use this method.
  2. Download a country code mapping from some web source which has country names against these codes.

Also, what you are trying to achieve with this country code and country name in Power BI will help in understanding what a proper solution could be.

For example, if you want to create a map visual, then Power BI does recognises country codes on it. But still more details on this will be helpful.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

4 REPLIES 4
ctope
New Member

So I just opened the raw data file in excel and changed the country code column to a geography data type and inserted a new column that referenced the country code column then just put .name example =B2.Name. Then just copied and pasted the values and changed the country code column back to a text field and saved and closed. Then you could just use that as another data source.

ctope_0-1643895969118.png

 

Pragati11
Super User
Super User

Hi @utsavpatel ,

 

There is no in-built functionality in Power BI that by-default creates a column with country name for you against these country codes.

  1. You can create a calculated column which assigns a country name value against these country codes. But this may not be appropriate as you may have multiple country codes in your data. If there are like just for example 5 country codes then you can use this method.
  2. Download a country code mapping from some web source which has country names against these codes.

Also, what you are trying to achieve with this country code and country name in Power BI will help in understanding what a proper solution could be.

For example, if you want to create a map visual, then Power BI does recognises country codes on it. But still more details on this will be helpful.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

amitchandak
Super User
Super User

@utsavpatel , I doubt such functionality. You might have get some code descirption data and merge it.

@amitchandak What do you mean by code description data?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.