Adding Your Own ESRI Shape Files to Power BI: Part 2 Loading the Data into Power BI

In the previous post the process for preparing your TopoJSON file from ESRI .shp files was outlined. The following steps will guide you through the process to load and interact with your TopoJSON file.

  1. In Power BI, the “Shape Map” is included as a Preview Feature. You can activate it by clicking on “File” then selecting “Options and Settings” and then Clicking on “Options”. This will open up the following dialogue box where you can select the “Preview Features” tab and click on “Shape Map visual”.

2. Click on the “Shape Map” icon which looks like this:

from the Visualizations pane to add the visual in your Power BI Report.

3. In the “Location” dialogue box, drag and drop a field from one of the tables you have already loaded. It doesn’t matter which field you select, you just need a field to be selected so you can get to the next step and load the TopoJSON file.

4. At the top of the Visualizations pane, click on the middle “Format visual” icon:

Then click on the “Map Settings” and scroll down to the bottom and select “Custom map”

5. Click on “Add a map type”, click on “All Files (*.*) and browse to the location of your TopoJSON file and select it.

6. At this point, you should be able to see your map in Power BI:

6. Now that your map is loaded, you you can load additional files into Power BI and use their fields to color code your map with the “Colour saturation” setting

Make sure you take out the arbitrary field you added to see the map, and add in the field that is more appropriate for your project.

Additional Consideration

It is important to note that although the Power BI is able to display all of the Dissemination Areas (DAs) in Toronto, there is an upper limit on the number of shapes that it can color code. Depending on the geography you are working with, you may need to think of your area in sections to be able to display your color coded data appropriately.

Adding Your Own ESRI Shape Files to Power BI: Part 1 Converting to TopoJSON

Although the generic maps available in in Power BI are useful, sometimes you have a project that uses its own geography. If you are working with ESRI or other shape

file formats, Power BI has a visual called “shape map” that gives you the capacity to add your own maps to a report, so you can show and interact with your data by area. The advantage of the shape map option is that you do not need to have an ESRI license. You do, however, need to format the .shp files in a particular way to make them accessible. This article provides a step-by-step walk through to get the benefits of your own geography in Power BI reports.

Getting the Correct Files

To begin, you will need a the shapefile and csv for your map. The shapefile will be used for the actual map, and the csv will be used to represent data on the map. The shapefile and csv will need some common column so that Power BI knows which value corresponds to which location. A quick way to get a usable csv is to convert the dbf to csv.

Converting File Formats

Power BI can only load topojson formats for a shape map, so first you will have to convert your shapefile to topojson. One way this can be done is by using QGIS. The next slides will show how to use QGIS to convert a shapefile to topojson.

  1. Load your data into QGIS. The following example uses 2016 “Dissemination Area” shape files for Toronto from Statistics Canada.

***IMPORTANT***

The conversion process that you will work through requires the ESRI .shp file you just loaded to be using the EPSG4326 coordinate reference system (CRS). If you are using a different CRS, your TopoJSON file will look unrecognizable.

2. Click on “Plugins” and select “Manage and Install Plugins…”

3. Go to “All” and find the “TopoJSON Writer” plugin and click “Install Plugin”

4. You may have to restart QGIS to see the plugin, but it will appear in the plugins area on your toolbar. Click on the TopoJSON Writer icon.

5. In the TopoJSON dialogue box, use the following settings:

With your shape file converted, you are now ready to use it in Power BI, which will be the focus of the next post.