This is blog number two highlighting some great Power BI features that I’ve used to build my Norwegian Population report. Today’s topic is the Shape Map visual in Power BI.
Introducing the Shape Map visual
There are lots of different options in Power BI when it comes to visualizing georaphical data. I am a big fan of the Shape Map. Whilst it lacks the sophistication of adding layers that you get with ArcGIS maps, it’s really simple to use, is snappy, and has lots of formatting options. It comes built it with maps of various countries at state/region level, but it’s also possible to add your own custom maps, which is really useful if you have floorplans, or any other image you want to map out and visualize the data of.
It’s been in preview for as long as I can remember, so you need to click the checkbox to allow it as a preview feature in Power BI Options.
How does it work?
Shape Map comes with some built in maps you can select in ‘Map Settings’. It works by referencing a “shape” created in TOPO JSON format. Effectively, this is a bunch of shapes on an image drawn with co-ordinates. Each image then contains various attributes stored in a table. These are the rows you see when you select ‘View map key type’. Each row will be related (I don’t want to say mapped) to your data by a common field in order to show up on the map.
The ‘Australia: States’ map with the Map Keys highlighted.
Custom map
Another great benefit of Shape Map is you’re not limited to the maps that come installed with the visual. You can import and use any map that is in the TOPO JSON format. This makes the visual super flexible. What if your Sales team isn’t seperated perfectly into cities or regions? Or what if you are showing data on a building your company owns? Well, you can draw your own map.
Installing a custom map
Norway unfortunately doesn’t feature on the built in maps, so I had to import my own. Thankfully, David Eldersveld has created some really useful Norwegian maps that I can download and pull straight into Power BI. Once you have saved the file you want locally, go to ‘Map settings’, select ‘Custom map’ once you’ve added a Shape Map to the canvas.
It’s then just a case of adding your location dimension from your data (here, Kommune) which matches the location name in the map file, along with a measure to indicate the colour saturation, and you’re good to go.
Summary
Overall, I’m a fan of this visual. It’s simple, effective, and customizable. One downside I wanted to highlight is it’s not possible to add levels of hierarchy. On my Norwegian population report, I use the visual twice; Fylke (Level1) visible on the left, and Kommune (Level2), with Fylke being used primarily as a filter. I could have also used bookmarks to show and hide the different levels. This might be useful if you have a lot of levels, but here I feel this approach works just fine in this example. What do you think?