In this tutorial, you will learn how to create and add a custom map to the Shape map visual of Power BI. I choose my beloved country Algeria as an example.
- Find shape map on the web
- Create the JSON shape map file
- Add the JSON file to Power BI visual
Step 1 : Find shape map on the web
It’s pretty easy to find shape of any map on the internet. For the Algerian map, you can download it from the Algerian national Institute of Cartography and remote sensing website, here. Once the RAR file downloaded, you need only to extract the folder « division administrative polygone_dza »
Step 2 : Create the JSON shape map file
To create the JSON file, we will use the website mapshaper.org.
You have to drag all the files from the extracted folder into the mapsharper editor then you click on Import.
You will get the map of Algeria that you have to download by clicking on the Export button, in the TopoJson format.
As shown in the image :
Step 3 : Add the JSON file to Power BI visual
First, because is still as preview features, you have to add the Shape map visual feature from the option menu :
We have a table with the name of departments, we call them wilayas in Algeria, and value for each wilaya.
You choose the shape map from the visualization pane, then put wilaya in the Location field and value in color saturation and you will get the USA map as a result
In the format pane, click on the + Add map and select the JSON file created in step 2
And you will get this beautiful filled map that you can customize in the format pane
By clicking in the button View map keys, you can see the region names and their keys. This will help you when you create your data table (you have to write the region names in the same syntax).
That’s it. I hope that this tutorial will help you. And don’t hesitate to ask any question.
See you in my next post. Enjoy 😊