Filled maps and shape maps in Power BI

How filled (choropleth) maps and shape maps in Power BI colour regions by a measure, when to use each, custom TopoJSON and GeoJSON maps for territories and floor plans, map keys, the DAX for fair comparisons, and the Bing deprecation.

Short answer: a filled map (choropleth) and a shape map both colour regions by a measure: darker is more. The filled map uses Bing Maps to find the shapes of countries, states, counties or postcodes from their names, on a real background map. The shape map (in preview) draws only the regions, from built-in maps or your own TopoJSON or GeoJSON file, so it can show sales territories, a store's floor plan or a seating chart. Bing-based maps are scheduled for deprecation; the Azure Maps visual has a filled layer as the long-term home.

"Which region is strongest?" is a map question when the reader knows the regions by their place. A shaded map of 16 German states is read faster than a list of 16 names, as long as the measure is fair to big and small regions.

Filled map or shape map?

FeatureFilled mapShape map
Shapes come fromBing, by the region's namebuilt-in maps or your TopoJSON or GeoJSON file
Backgrounda real map with roads and labelsonly the regions
Custom regionsnoyes: territories, districts, floor plans, seating charts
Geocodingnames sent to Bingnone for custom maps: names matched to the file's keys
StatusBing-based, scheduled for deprecationpreview
Two ways to colour regions

How do you build a filled map?

  1. Set the column's Data category in the model (Country/Region, State or Province, County, Postal code).
  2. In Visualizations pick Filled map, drag the region to Location and a measure to Tooltips or use it for the colour.
  3. Format visual, Fill colors, fx: a Gradient on the measure (light for low, dark for high), or Rules for bands.

Power BI sends the Location values to Bing to find the shapes. Microsoft lists the URLs your firewall may need to allow, and recommends starting new reports on Azure Maps because of the planned deprecation.

How do you build a shape map with your own regions?

  1. If the Shape map visual is not in the pane, turn it on in Power BI Desktop under Options, Preview features.
  2. Pick Shape map, drag the region field to Location and the measure to Color saturation.
  3. In Format visual, Map settings, choose a built-in map or Custom map and upload a .topojson or .geojson file, or paste a URL (a measure can provide the URL through fx).
  4. Select View map type key to see the names or IDs the map uses. Your Location values must match them exactly.

Microsoft's example is US judicial districts: states split into districts no standard map has, so a custom TopoJSON file provides them. TopoJSON files are usually smaller, because shared borders are stored once; both formats work.

How do you make the colours fair?

A map coloured by total revenue mostly shows population. Colour by a rate:

Revenue = SUM ( Sales[Amount] )

Revenue per 1,000 Inhabitants =
DIVIDE ( [Revenue], SUM ( Region[Population] ) / 1000 )

Customer Penetration % =
DIVIDE ( DISTINCTCOUNT ( Sales[Customer ID] ), SUM ( Region[Households] ) )
StateRevenuePopulationRevenue per 1,000
Bavaria4.2 M13.4 M313
Saxony0.9 M4.1 M220
Hamburg0.8 M1.9 M421

By total, Bavaria is darkest. By revenue per 1,000 inhabitants, Hamburg is.

What goes wrong?

  • Names that do not match. "Bayern" in the data and "Bavaria" in the map, or a postcode stored as a number that lost its leading zero. Check the map keys; store codes as text.
  • Ambiguous names on a filled map. Add the country, or a hierarchy (country, then state), so Bing looks in the right place.
  • Totals instead of rates. Big regions win every map of totals.
  • Too many shades. A gradient with a diverging centre (below and above a target) reads better than nine shades of one colour.
  • Small regions disappear. City states and small counties are hard to see; add a table or bar chart next to the map.

Where can you check this?

Where do you start?

Use a shape map when your regions are your own (territories, districts, floors), a filled layer in Azure Maps for standard regions on a real map, and colour by a rate, not a total. The Azure Maps visual covers points, bubbles and routes.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.