Power BI Custom Maps — Part III: Mapbox 3D Choropleth Map
By: Selina Li
Tags: 3d Map, Power Bi, Melboure, Housing Prices, Mapbox

Mapbox 3D Choropleth Map

In Power BI Desktop, open a new page.

Step 1: Sign up for a Mapbox account

Go to https://account.mapbox.com/auth/signup/ and sign up as a user

Step 2: Get your free access token

After signup, you will see your free access token at https://account.mapbox.com/access-tokens/

Mark this token down (e.g. copy and paste it to NOTEPAD++ or NOTES) for use in below steps

Step 3: Download VIC suburb/localities shapefile from website

This is exactly the same as what we did for the shape map.

Download Victoria suburb/localities shapefile from this website: https://data.gov.au/dataset/ds-dga-af33dd8c-0534-4e18-9245-fc64440f742e/distribution/dist-dga-3b946968-319e-4125-8971-2a33d5bf000c/details?q=melbourne%20suburb

The downloaded file is named “viclocalitypolygonshp.zip”. If you unzip it, you will see the shapefile with the suffix “.shp”.

Step 4: Upload tileset to Mapbox

As we need to reference the geospatial data, we need to create a tileset through Mapbox first

Let’s go to the Tilesets page (https://studio.mapbox.com/tilesets/) in Mapbox Studio.

Click on the New tileset button.

In the New tileset window, drag and drop our whole zip file “viclocalitypolygonshp.zip” directly into the window.

Click Confirm

We will need to wait for around 5 minutes before the file gets uploaded.

Upon uploading done, you will see a tileset gets created after the 6 default tilesets — this is your new tileset

Click on it to open your new tileset’s information page:

The tileset’s information page includes:

the map ID: mydemo.bcll8ft7 the layer’s name: viclocalitypolygonshp-c0wjv6 the layer’s properties: VIC_LOCA_2

all of which we will need to reference when creating the choropleth map

Step 5: Power BI import Mapbox visual from marketplace

Back to Power BI, open a new page

In the Visualizations pane, click the Import a custom visual option, represented by a three-dot icon

Select “Import from marketplace”

In the prompted window, enter “Mapbox” in the search menu and press “Enter”

Click the Add button next to the Mapbox Visual option to import it to Power BI

Then we can see a blue Mapbox logo on the Visualizations pane.

Step 6: Add an access token

Click on the Mapbox icon to add a new visual

to add a new visual In the Fields tab of Visualization pane, drag the suburb field from data onto the Location shelf. You will see the visual populated with instructions on how to create your first visualization.

tab of pane, drag the field from data onto the shelf. You will see the visual populated with instructions on how to create your first visualization. Copy the Mapbox Access token you got from Step 2 above.

you got from Step 2 above. Back in Power BI, go to the Format tab of Visualization pane > open the Viz Settings option > Paste access token in the Access token field

Step 7: Turn on choropleth

In the Format tab, switch the Circle option off and turn the Choropleth option on.

Step 8: Configure choropleth layer settings

In the Format tab, click on Choropleth to open the choropleth layer settings.

Under Choropleth layer settings:

Scroll down a bit to find “Data Level 1” , click on the Data Level 1 dropdown > Select the Custom Tileset option.

, click on the > Select the option. In the Vector Tile URL Level 1 field, paste the map ID of the tileset. The map ID in this field must always be preceded by mapbox:// .

field, paste the map ID of the tileset. The map ID in this field must always be preceded by . In the Source Layer Name Level 1 field, paste the layer’s name.

field, paste the layer’s name. In the Vector Property Level 1 field, enter the unique identifier property name, in this case VIC_LOCA_2 .

Step 9: Generate the choropleth map

Click on the Fields tab again. Make sure Suburb field is on Location shelf. Drag the Median Price field from the data options onto the Color shelf.

Where is our cholorpleth? ZOOM IN your map to the Melbourne area —

Magic time!

Step 10: Turn choropleth into 3D

In the Fields tab, drag the Median Price field from the data options onto the Size shelf.

The map becomes 3D now!

Step 11: Play with it!

Use your mouse to hover over the suburbs and you can see tooltips for each of them

You can also see how the 3D effects change as you drag the map around from different perspective.

Play with it as you like!

Congratulations! You have done a wonderful 3D map showing housing prices for Melbourne suburbs!

This is the end of the tutorial. Please feel free to leave your questions and comments below. We are happy to discuss!