Maps – they’re everywhere. We have instant access to detailed electronic maps directly from our phones, tablets, computers, and cars. For some, old and usually outdated maps are used as artwork to hang on walls. For others, the humongous folded paper maps found in a car door side pocket are still the go-to map when electronic maps are not available (just remember to update it periodically as roads may have changed during the past 50 years). From a technology standpoint, the coronavirus pandemic demonstrated the critically important need for digital mapping services. Maps relayed information about COVID-19 case levels, hospitalizations, deaths, and vaccine availability in a familiar and easy-to-use visualization. Vast amounts of data from all over the world were consolidated and made available at aggregate global and granular local levels through maps.
Given the ubiquity of maps, I incorrectly assumed that including a map visualization in Power BI would be a simple exercise. Well, adding the visual itself is very easy, but having the data rendered correctly is not as straightforward. This isn’t entirely the fault of Power BI (there are some Power BI specific issues). I was quickly reminded that the world is a complicated place. Continents, regions, countries, and cities may be referred to by different names. Complex geopolitical factors play into the recognition of a country as a sovereign entity or as a territory of another entity. There are disputed lands that may or may not be recognized as sovereign entities or they may be considered parts of multiple different countries depending on political perspective. Even assigning a particular country to a continent is not simple since some countries span multiple continents while other countries bordering multiple continents may prefer to be recognized as part of one continent over another regardless of geological assignment.
In short, mapping is a challenging exercise no matter what service is used. As I mentioned earlier, these challenges are not specific to Power BI. As a Microsoft product, Power BI uses Bing for its mapping services. This adds another layer of complexity since Bing may recognize locations differently than Google Maps or any other service in terms of location naming, borders, and political recognition. From a continent and country naming perspective, the examples below were tested with Power BI.
Enabling Map Visuals in Power BI
Power BI map visualizations are not enabled by default due to security reasons. Data used to render maps in Power BI are transmitted externally since Power BI uses Bing as its mapping service. If the report or dashboard contains sensitive information that should not be transmitted externally, you may want to consider an alternate solution.
To use the Map or Filled Map visualizations, you may need to enable a security option if the error “Map and filled map visuals are disabled” is displayed (screenshot below).
- From the Power BI application menu, click File.
- Click Options and settings.
- Click Options. The Options window is displayed.
- Within the Global section, click Security.
- In the list of Security options, find the Map and Filled Map visuals section and enable the Use Map and Filled Map visuals option.
- Click the OK button to close the Options window.
The seven continents recognized by Power BI are listed below. Please be aware that the terms Australia and Oceania are not interchangeable with respect to recognized continent names. As an example, the term Australia when used as a continent name in Power BI does not fill New Zealand on a Filled Map visualization. However, the term Oceania, when set to the Data category of Continent, does fill New Zealand. My understanding is that Oceania is considered a region instead of a continent even though the terms are used interchangeably in some parts of the world.
- North America
- South America
Columns containing continent names should be set to the Continent data category. Click on the field containing continent names. On the Column tools menu for that column, set the Data category to Continent.
Map Visualization Using Continent Names
Using the listed continent names, a Map visualization places the bubbles at a central point in the expected locations.
Filled Map Visualization Using Continent Names
Using a Filled Map visualization instead of a Map visualization produces some unexpected results. All of the continents are filled as expected, however, Asia appears to be filled more than once since it has a darker fill color in the following screenshot. Hovering over Asia displays the label Europe. It seems Asia is filled based on both the Asia and Europe continent names.
Another peculiarity with the Filled Map visualization is that some island nations and territories are not filled when using continent names. As an example, Cuba, Haiti, and Dominican Republic are filled as expected but Jamaica is not filled.
Mapping country data is where the process starts to become really interesting and problematic. I searched for a reference list of valid country names for Power BI and could not find a single, consistent reference. Without delving into geopolitics, there are many partially recognized countries, disputed lands, and territories. Countries found on one reference list may not be found on other lists if the country/sovereign is not recognized by the organization maintaining the list. Also, simply finding a country listed on a country reference list does not guarantee that Power BI recognizes the country as part of its mapping service with Bing. Let’s not forget that naming is not consistent either as countries tend to have various official and unofficial names that may or may not be recognized by Power BI or Bing. Is it the United States of America or United States or U.S. or U.S.A. or America?
In no way do any of the following country name lists represent an official or accurate or complete country name reference. They only serve to provide a list of tested names (at the time this was written) that are generally recognized by the Power BI mapping service when the Data category is set to Country. From the reference lists I found, these country names were commonly found as recognized countries. If you think a country name is missing, then feel free to add it to your report and make sure it is recognized by Power BI. If you feel a country belongs to Asia instead of Europe, then please make that adjustment in your report and test.
I also included a list of additional names that the Power BI mapping service recognizes when the Data category is set to Country. Again, this is not an accurate or complete list so please use it with caution, e.g., Puerto Rico is recognized when categorized as a Country in Power BI but it is regarded as a territory of the United States. Generally, these entries tend to be islands, partially recognized states, disputed lands, territories of other countries, etc.
Columns containing country names should be set to the Country data category. Click on the field containing country names. On the Column tools menu for that column, set the Data category to Country.
There are 54 countries associated with Africa as listed below. The Map visualization is rendered as expected, however, the Filled Map visualization appears to have unfilled areas in Sudan and South Sudan along with a few surrounding islands and territories.
- Burkina Faso
- Cape Verde
- Central African Republic
- Côte d’Ivoire
- Democratic Republic of the Congo
- Equatorial Guinea
- Republic of the Congo
- São Tomé and Príncipe
- Sierra Leone
- South Africa
- South Sudan
- The Gambia
There are 47 countries associated with Asia as listed below. The Map visualization is rendered as expected, however, the Filled Map visualization appears to have unfilled areas along the border of China with India, Kyrgyzstan, and Kazakhstan as well as unfilled surrounding islands and territories. There are also unfilled areas with respect to Israel and Palestine.
- North Korea
- Saudi Arabia
- South Korea
- Sri Lanka
- United Arab Emirates
There are 14 countries associated with Australia as listed below. Both the Map and Filled Map visualizations appear to be rendered as expected.
- Federated States of Micronesia
- Marshall Islands
- New Zealand
- Papua New Guinea
- Solomon Islands
There are 44 countries associated with Europe as listed below. The Map visualization is rendered as expected, however, the Filled Map visualization appears to double-count Italy as represented by a darker fill color. I assume this is due to Vatican City existing within Italian borders.
- Bosnia and Herzegovina
- North Macedonia
- San Marino
- United Kingdom
- Vatican City
There are 22 countries associated with North America as listed below. Both the Map and Filled Map visualizations appear to be rendered as expected.
- Antigua and Barbuda
- Costa Rica
- Dominican Republic
- El Salvador
- Saint Kitts and Nevis
- Saint Lucia
- Saint Vincent and the Grenadines
- United States
There are 13 countries associated with South America as listed below. The Map visualization is rendered as expected. The Filled Map visualization has a strange blank square area within Brazil but otherwise appears as expected.
- Trinidad and Tobago
Other Countries, Territories, and Lands
Listed below are 51 other possible countries, territories, islands, and lands which may or may not be sovereign countries, however, Power BI and Bing recognize the names and renders them on map visualizations when the Data category is set to Country.
- American Samoa
- Bouvet Island
- British Indian Ocean Territory
- British Virgin Islands
- Cayman Islands
- Christmas Island
- Cocos (Keeling) Islands
- Cook Islands
- Falkland Islands
- Faroe Islands
- French Guiana
- French Polynesia
- French Southern and Antarctic Lands
- Heard Island and McDonald Islands
- Hong Kong
- Isle of Man
- New Caledonia
- Norfolk Island
- Northern Mariana Islands
- Pitcairn Islands
- Puerto Rico
- Saint Barthelemy
- Saint Helena, Ascension and Tristan Da Cunha
- Saint Martin
- Saint Pierre and Miquelon
- Sint Maarten
- South Georgia and South Sandwich Islands
- Turks and Caicos
- Wallis and Futuna
For additional information on Power BI mapping, please consider reading the related post discussing Mapping Cities in Power BI.