Power BI Map Visualizations: Mapping Continents and Countries
Maps are 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.
I thought adding a map visualizations to Power BI would be straightforward given their ubiquity. While adding the visualization is simple, getting the data to render correctly is more complicated. This is partly due to issues specific to Power BI, but the complexity also reflects how intricate the world is. Continents, regions, countries, and cities can have different names and political statuses. Disputed territories might be recognized differently depending on political perspectives and countries that span multiple continents can be challenging to categorize.
In summary, mapping is inherently complex, regardless of the service used. Power BI, which relies on Bing for its mapping services, adds another layer of complexity. Bing might recognize locations differently than Google Maps or other mapping services in terms of naming, borders, and political status. The examples below illustrate some of these challenges with Power BI.
Enabling Map Visualizations 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.
- From the Power BI application menu, click
File
. - Click
Options and settings
. - Click
Options
. TheOptions
window is displayed. - Within the
GLOBAL
section, clickSecurity
. - In the list of
Security
options, find theMap and Filled Map visuals
section and enable theUse Map and Filled Map visuals
option. - Click the
OK
button to close theOptions
window.
Continents
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.
Columns containing continent names should be set to the Continent
data category.
- From the
Data
pane, select the data field containing continent names. - On the
Column tools
ribbon, setData category
toContinent
.
CONTINENT |
---|
Africa |
Antarctica |
Asia |
Australia |
Europe |
North America |
South America |
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, some island nations and territories are not filled when using continent names only. As an example, Cuba, Haiti, and Dominican Republic are filled as expected but Jamaica and Puerto Rico are not filled.
Countries
Mapping country data is both fascinating and problematic. I looked for a reference list of valid country names for Power BI but couldn’t find a single, consistent source. There are many partially recognized countries, disputed territories, and varying names. Countries listed in one reference might not appear in another if they aren’t recognized by the organization maintaining the list. Even if a country is listed, Power BI might not recognize it in its Bing mapping service. Also, country names vary — are we referring to the United States, the United States of America, the U.S., U.S.A., or America?
The country name list I have assembled is neither official nor complete. It simply includes names that were recognized by Power BI’s mapping service at the time the list was assembled. If you think a country is missing or incorrectly categorized, you can adjust it in your report and test the results.
I’ve also included a list of additional names recognized by Power BI’s mapping service when the Data category
is set to Country
. Note that this is not a comprehensive list, so use it carefully. For example, Puerto Rico is listed as a country in Power BI but is actually a U.S. territory.
Columns containing country names should be set to the Country
data category.
- From the
Data
pane, select the data field containing country names. - On the
Column tools
ribbon, setData category
toCountry
.
Africa
There are 54 countries associated with Africa. 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.
Asia
There are 47 countries associated with Asia. 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.
Australia
There are 14 countries associated with Australia. Both the Map and Filled Map visualizations appear to be rendered as expected.
Europe
There are 44 countries associated with Europe. 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.
North America
There are 22 countries associated with North America. Both the Map and Filled Map visualizations appear to be rendered as expected.
South America
There are 13 countries associated with South America. Both the Map and Filled Map visualizations appear to be rendered as expected. French Guiana is listed in the other countries, territories, and lands section so it remains unmarked and unfilled here.
Other Countries, Territories, and Lands
There 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
.
Combined Country List
AFRICA | ASIA | AUSTRALIA | EUROPE | NORTH AMERICA | SOUTH AMERICA | OTHER |
---|---|---|---|---|---|---|
Algeria | Afghanistan | Australia | Albania | Antigua and Barbuda | Argentina | American Samoa |
Angola | Armenia | Federated States of Micronesia | Andorra | Bahamas | Bolivia | Anguilla |
Benin | Azerbaijan | Fiji | Austria | Barbados | Brazil | Antarctica |
Botswana | Bahrain | Kiribati | Belarus | Belize | Chile | Aruba |
Burkina Faso | Bangladesh | Marshall Islands | Belgium | Canada | Colombia | Bermuda |
Burundi | Bhutan | Nauru | Bosnia and Herzegovina | Costa Rica | Ecuador | Bonaire |
Cameroon | Brunei | New Zealand | Bulgaria | Cuba | Guyana | Bouvet Island |
Cape Verde | Cambodia | Palau | Croatia | Dominica | Paraguay | British Indian Ocean Territory |
Central African Republic | China | Papua New Guinea | Czechia | Dominican Republic | Peru | British Virgin Islands |
Chad | Cyprus | Samoa | Denmark | El Salvador | Suriname | Cayman Islands |
Comoros | Georgia | Solomon Islands | Estonia | Grenada | Trinidad and Tobago | Christmas Island |
Côte d’Ivoire | India | Tonga | Finland | Guatemala | Uruguay | Cocos (Keeling) Islands |
Democratic Republic of the Congo | Indonesia | Tuvalu | France | Haiti | Venezuela | Cook Islands |
Djibouti | Iran | Vanuatu | Germany | Honduras | Curaçao | |
Egypt | Iraq | Greece | Jamaica | Falkland Islands | ||
Equatorial Guinea | Israel | Hungary | Mexico | Faroe Islands | ||
Eritrea | Japan | Iceland | Nicaragua | French Guiana | ||
Eswatini | Jordan | Ireland | Panama | French Polynesia | ||
Ethiopia | Kazakhstan | Italy | Saint Kitts and Nevis | French Southern and Antarctic Lands | ||
Gabon | Kuwait | Latvia | Saint Lucia | Gibraltar | ||
Ghana | Kyrgyzstan | Liechtenstein | Saint Vincent and the Grenadines | Greenland | ||
Guinea | Laos | Lithuania | United States | Guadeloupe | ||
Guinea-Bissau | Lebanon | Luxembourg | Guam | |||
Kenya | Malaysia | Malta | Guernsey | |||
Lesotho | Maldives | Moldova | Heard Island and McDonald Islands | |||
Liberia | Mongolia | Monaco | Hong Kong | |||
Libya | Myanmar | Montenegro | Isle of Man | |||
Madagascar | Nepal | Netherlands | Jersey | |||
Malawi | North Korea | North Macedonia | Kosovo | |||
Mali | Oman | Norway | Macao | |||
Mauritania | Pakistan | Poland | Martinique | |||
Mauritius | Philippines | Portugal | Mayotte | |||
Morocco | Qatar | Romania | Montserrat | |||
Mozambique | Saudi Arabia | Russia | New Caledonia | |||
Namibia | Singapore | San Marino | Niue | |||
Niger | South Korea | Serbia | Norfolk Island | |||
Nigeria | Sri Lanka | Slovakia | Northern Mariana Islands | |||
Republic of the Congo | Syria | Slovenia | Pitcairn Islands | |||
Rwanda | Tajikistan | Spain | Puerto Rico | |||
São Tomé and Príncipe | Thailand | Sweden | Réunion | |||
Senegal | Timor-Leste | Switzerland | Saint Barthelemy | |||
Seychelles | Turkey | Ukraine | Saint Helena, Ascension and Tristan Da Cunha | |||
Sierra Leone | Turkmenistan | United Kingdom | Saint Martin | |||
Somalia | United Arab Emirates | Vatican City | Saint Pierre and Miquelon | |||
South Africa | Uzbekistan | Sint Maarten | ||||
South Sudan | Vietnam | South Georgia and South Sandwich Islands | ||||
Sudan | Yemen | Svalbard | ||||
Tanzania | Taiwan | |||||
The Gambia | Tokelau | |||||
Togo | Turks and Caicos | |||||
Tunisia | Wallis and Futuna | |||||
Uganda | ||||||
Zambia | ||||||
Zimbabwe |
Summary
Integrating map visualizations into Power BI can be challenging due to geopolitical complexities and varying naming conventions used by different mapping services. Although adding a map visualization in Power BI is straightforward, ensuring accurate data rendering is complicated by these inconsistencies.