Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
Solved! Go to Solution.
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
@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.
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
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
Did you declare the category for that field as "Country" ?
User | Count |
---|---|
84 | |
76 | |
74 | |
49 | |
39 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |