With the update of Power BI last week you can now add your own maps in any size or shape to Power BI so you can extend the set of out of the box shapes that come with Power BI. This is possible because the Shape map visual is build upon TopoJSON which is an extension of the the GEOJSON standard. This makes it super easy to add any map you want,. In this blog post we will take a quick look at the existing set of maps and also create one ourselves.
First you need to enable the preview feature in Power BI Desktop:
Next you can drag in the ShapeMap onto the Canvas and assign a column to the location that allows the ShapeMap visual to highlight the shapes to highlight. You can then select the map you want to use, Power BI comes with a set of predefined maps. In my case I pick the Netherlands. Now to to highlight the area of the chart based on your data it has a set of predefined keys defined in any shape, you can view how the shapes can be mapped to your data by clicking “View map keys
Here is the list of keys I can use in my data to map my data with:
That will translate this data:
Into this map using the sales as Saturation:
But since the latest release you can now also add your own map. As the map files are based upon open standard there is a lot of information available on the web, I downloaded some examples from http://mapstarter.com/
For example I now have a map of Africa:
and again it provides me with a list of keys I can connect my data to:
Or a map of the entire world:
So how do you get one yourself. The easiest way I found is to download topojson sample files, but there aren’t too many around there. Any easier way is to use shape file and these are in abundance. Once you have one go to http://www.mapshaper.org/ load in the shape file and export as topojson, the load it into Power BI. Here I did one for the map of India:
As you can see you can load almost anything into Power BI now, you could create anything yourself in the shp format and then load it into PowerBI, I downloaded this random shape from the web and loaded it into Power BI:
So you can imagine loading in a factory floor, sports arena, hangar, oil field or airstrip and visualizing it with Power BI.
Here are some other interesting links I found where you can download most the JSON files I used for the sample above:
- Everything you want to know about GEOJSON
- GEOJSON AND KML DATA FOR THE UNITED STATES
- Convert GeoJSON to TopoJSON using http://geojson.io, or http://mapshaper.org
- How to make a map guide
David Eldersveld also wrote a great post that helps solve an issue where you have image drawing problems in Power BI.