Use any map with Power BI

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:

image

 

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

image

 

Here is the list of keys I can use in my data to map my data with:

image

That will translate this data:

image

Into this map using the sales as Saturation:

image

 

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:

image

and again it provides me with a list of keys I can connect my data to:

image

 

Or a map of the entire world:

image

And Japan

 

image

 

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:

image

 

 

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:

image

 

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:

have fun..

David Eldersveld also wrote a great post that helps solve an issue where you have image drawing problems in Power BI.