John Dalesandro

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.

  1. From the Power BI application menu, click File.
  2. Click Options and settings.
  3. Click Options. The Options window is displayed.
  4. Within the GLOBAL section, click Security.
  5. In the list of Security options, find the Map and Filled Map visuals section and enable the Use Map and Filled Map visuals option.
  6. Click the OK button to close the Options 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.

  1. From the Data pane, select the data field containing continent names.
  2. On the Column tools ribbon, set Data category to Continent.
CONTINENT
Africa
Antarctica
Asia
Australia
Europe
North America
South America
Data Table: Continent names

Map Visualization Using Continent Names

Using the listed continent names, a Map visualization places the bubbles at a central point in the expected locations.

Map visualization using continent names
Map visualization using continent names

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.

Filled Map visualization using continent names
Filled Map visualization using continent names

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.

  1. From the Data pane, select the data field containing country names.
  2. On the Column tools ribbon, set Data category to Country.

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.

Map visualization using country names (Africa)
Map visualization using country names (Africa)
Filled Map visualization using country names (Africa)
Filled Map visualization using country names (Africa)

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.

Map visualization using country names (Asia)
Map visualization using country names (Asia)
Filled Map visualization using country names (Asia)
Filled Map visualization using country names (Asia)

Australia

There are 14 countries associated with Australia. Both the Map and Filled Map visualizations appear to be rendered as expected.

Map visualization using country names (Australia)
Map visualization using country names (Australia)
Filled Map visualization using country names (Australia)
Filled Map visualization using country names (Australia)

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.

Map visualization using country names (Europe)
Map visualization using country names (Europe)
Filled Map visualization using country names (Europe)
Filled Map visualization using country names (Europe)

North America

There are 22 countries associated with North America. Both the Map and Filled Map visualizations appear to be rendered as expected.

Map visualization using country names (North America)
Map visualization using country names (North America)
Filled Map visualization using country names (North America)
Filled Map visualization using country names (North America)

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.

Map visualization using country names (South America)
Map visualization using country names (South America)
Filled Map visualization using country names (South America)
Filled Map visualization using country names (South America)

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.

Map visualization using country names (Other countries, territories, and lands)
Map visualization using country names (Other countries, territories, and lands)
Filled Map visualization using country names (Other countries, territories, and lands)
Filled Map visualization using country names (Other countries, territories, and lands)

Combined Country List

AFRICAASIAAUSTRALIAEUROPENORTH AMERICASOUTH AMERICAOTHER
AlgeriaAfghanistanAustraliaAlbaniaAntigua and BarbudaArgentinaAmerican Samoa
AngolaArmeniaFederated States of MicronesiaAndorraBahamasBoliviaAnguilla
BeninAzerbaijanFijiAustriaBarbadosBrazilAntarctica
BotswanaBahrainKiribatiBelarusBelizeChileAruba
Burkina FasoBangladeshMarshall IslandsBelgiumCanadaColombiaBermuda
BurundiBhutanNauruBosnia and HerzegovinaCosta RicaEcuadorBonaire
CameroonBruneiNew ZealandBulgariaCubaGuyanaBouvet Island
Cape VerdeCambodiaPalauCroatiaDominicaParaguayBritish Indian Ocean Territory
Central African RepublicChinaPapua New GuineaCzechiaDominican RepublicPeruBritish Virgin Islands
ChadCyprusSamoaDenmarkEl SalvadorSurinameCayman Islands
ComorosGeorgiaSolomon IslandsEstoniaGrenadaTrinidad and TobagoChristmas Island
Côte d’IvoireIndiaTongaFinlandGuatemalaUruguayCocos (Keeling) Islands
Democratic Republic of the CongoIndonesiaTuvaluFranceHaitiVenezuelaCook Islands
DjiboutiIranVanuatuGermanyHondurasCuraçao
EgyptIraqGreeceJamaicaFalkland Islands
Equatorial GuineaIsraelHungaryMexicoFaroe Islands
EritreaJapanIcelandNicaraguaFrench Guiana
EswatiniJordanIrelandPanamaFrench Polynesia
EthiopiaKazakhstanItalySaint Kitts and NevisFrench Southern and Antarctic Lands
GabonKuwaitLatviaSaint LuciaGibraltar
GhanaKyrgyzstanLiechtensteinSaint Vincent and the GrenadinesGreenland
GuineaLaosLithuaniaUnited StatesGuadeloupe
Guinea-BissauLebanonLuxembourgGuam
KenyaMalaysiaMaltaGuernsey
LesothoMaldivesMoldovaHeard Island and McDonald Islands
LiberiaMongoliaMonacoHong Kong
LibyaMyanmarMontenegroIsle of Man
MadagascarNepalNetherlandsJersey
MalawiNorth KoreaNorth MacedoniaKosovo
MaliOmanNorwayMacao
MauritaniaPakistanPolandMartinique
MauritiusPhilippinesPortugalMayotte
MoroccoQatarRomaniaMontserrat
MozambiqueSaudi ArabiaRussiaNew Caledonia
NamibiaSingaporeSan MarinoNiue
NigerSouth KoreaSerbiaNorfolk Island
NigeriaSri LankaSlovakiaNorthern Mariana Islands
Republic of the CongoSyriaSloveniaPitcairn Islands
RwandaTajikistanSpainPuerto Rico
São Tomé and PríncipeThailandSwedenRéunion
SenegalTimor-LesteSwitzerlandSaint Barthelemy
SeychellesTurkeyUkraineSaint Helena, Ascension and Tristan Da Cunha
Sierra LeoneTurkmenistanUnited KingdomSaint Martin
SomaliaUnited Arab EmiratesVatican CitySaint Pierre and Miquelon
South AfricaUzbekistanSint Maarten
South SudanVietnamSouth Georgia and South Sandwich Islands
SudanYemenSvalbard
TanzaniaTaiwan
The GambiaTokelau
TogoTurks and Caicos
TunisiaWallis and Futuna
Uganda
Zambia
Zimbabwe
Data Table: All countries, territories, and lands

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.