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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
pelowski
Helper III
Helper III

Map Visual not color coding Peru

I have a table with ISO 3166-1 Alpha 3 codes that is mapped to Sales Regions.  When the Alpha 3 code is mapped to the "Location" field, the value for PER is not recognized as Peru.  This is true both in the desktop client and when the report is published in the service.  Any idea what is going on here?

Peru not color coded on Map Visual

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pelowski ,

 

Thanks for @lbendlin reply, that's really helpful!

 

@pelowski This is how the Location option is explained in the documentation: "The Location option must contain a valid value for Power BI to create the filled map. Valid locations include countries/regions, states, counties, cities, zip codes, postal codes, and so on". Create and use filled maps (choropleth maps) in Power BI - Power BI | Microsoft Learn

 

In my test, when I put Peru's Alpha-3 code into Location, the region couldn't be correctly identified. So, I recommend you create a custom column with Switch DAX to get entrie country names if the data doesn't contain too many countries.

CountryName = SWITCH('Table'[alpha-3],"PER","PERU",...)

 

Another method is to download a CSV file which has country names against these codes. Then map the corresponding full country name to your data.

 

 

 

Best regards,

Mengmeng Li

View solution in original post

4 REPLIES 4
pelowski
Helper III
Helper III

@Anonymous, thank you.  This is a servicable workaround.  But yeah, this seems like a bug because 99% of the other ISO codes work as expected.   I'm not sure what you mean by "Another method is to download a CSV file which has country names against these codes".  Are you talking about Microsoft's official supported list, because if so, I don't see that anywhere.  My list is already in a SQL table I generated years ago and matches up against the ISO 3166-1 codes I see listed elsewhere.

 

@lbendlin , yes I did that.  If I didn't, I don't think think that experience would've looked like what I show in my video.

Anonymous
Not applicable

Hi @pelowski ,

 

I mean you should be able to find a file on the web that contains most of the country names and matched Alpha-3 codes, which you can download and import into your report, and then create a one-to-many relationship with your current table. This is useful if you have a large number of countries in your original data, as it is cumbersome to manually enter each country and the corresponding Alpha-3 code in the Switch DAX.

 

 

Best regards,

Mengmeng Li

Anonymous
Not applicable

Hi @pelowski ,

 

Thanks for @lbendlin reply, that's really helpful!

 

@pelowski This is how the Location option is explained in the documentation: "The Location option must contain a valid value for Power BI to create the filled map. Valid locations include countries/regions, states, counties, cities, zip codes, postal codes, and so on". Create and use filled maps (choropleth maps) in Power BI - Power BI | Microsoft Learn

 

In my test, when I put Peru's Alpha-3 code into Location, the region couldn't be correctly identified. So, I recommend you create a custom column with Switch DAX to get entrie country names if the data doesn't contain too many countries.

CountryName = SWITCH('Table'[alpha-3],"PER","PERU",...)

 

Another method is to download a CSV file which has country names against these codes. Then map the corresponding full country name to your data.

 

 

 

Best regards,

Mengmeng Li

lbendlin
Super User
Super User

Did you declare the category for that field as "Country" ?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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