Logo

The Data Daily

Create data visualizations with the Mapbox Visual for Power BI

Create data visualizations with the Mapbox Visual for Power BI

Create data visualizations with the Mapbox Visual for Power BI
Prerequisite
Familiarity with Microsoft Power BI.
Create customizable heatmaps, point cluster maps, and graduated circle maps with the Mapbox Visual for Power BI using Microsoft Power BI Desktop and Online. The Mapbox Visual can be imported and accessed as a visualization plugin inside Power BI. This guide will walk through getting started with the Mapbox Visual and how to create a Mapbox-powered visualization in Microsoft Power BI . You will need a Mapbox account and a Microsoft Power BI account to complete this tutorial.
Getting started
Here are a few resources you'll need before you get started:
Mapbox account. You will need a Mapbox access token to add the Mapbox Visual in Power BI. Sign up for a free account on Mapbox .
Power BI account. Sign into your Power BI account or create a new one.
Mapbox Visual for Microsoft Power BI. You can either add the Mapbox Visual using the Power BI Marketplace, or you can download the latest Mapbox Visual from the open-source GitHub repository . Both of these options are explained in detail in the tutorial.
Data. This guide uses a sample CSV file with US healthcare spending derived from data.gov .
Start by adding data to a Power BI workspace.
Note
This guide walks through using the Mapbox Visual in Power BI Online. The process in Power BI Desktop is similar, but the interface is different.
Sign into your Power BI account.
Click Get Data to import or connect to a data source.
To import the healthcare data you downloaded earlier, choose to Import a File.
Choose Local file and upload the CSV file.
Note
You can use the Mapbox Visual for Microsoft Power BI with any dataset that contains geographic longitude and latitude data values.
Create a new report
In your Power BI workspace, navigate to the Datasets tab and create a new report by clicking the bar graph icon next to your new dataset. The report window will open and you will be able to edit your new report.
You'll add the Mapbox Visual using the Visualizations pane:
In the Visualizations pane, click the Import a custom visual option, represented by a three-dot icon.
Select Import from marketplace.
Enter "Mapbox" in the search menu and press enter.
Click the Add button next to the Mapbox visual option to add it to your Power BI report. It will appear as a blue Mapbox logo on the Visualizations toolbar.
Alternative workflow: Manual upload
Alternatively, you can download the latest Mapbox Visual for Power BI from Mapbox's open-source GitHub repository :
Click the Import a custom visual icon (three dots) and select Import from file.
Create a visualization
Click on the Mapbox icon in the Visualizations pane to add a new visualization to your report. While customizing your visualization, you'll work in both the Fields and Format panels within the Visualizations pane:
The Fields panel is where you will specify which data fields to associate with different types of Mapbox layers (for example map styles, heatmaps, circle maps, and cluster aggregation).
The Format panel is where you will specify the visualization style for each layer, such as color and radius.
Initialize a visualization
In the Fields panel, drag the latitude and longitude fields from your data onto the Latitude and Longitude shelves, and make sure that the Do not summarize option is checked for both fields. You should see the Mapbox visualization container populate with instructions on how to create your first visualization.
Connect your Mapbox account using your access token:
Click on the link, Click here to get a free Mapbox access token, in the visualization container. Accept the external link request if prompted. You will be forwarded to either the Mapbox sign up page or your Mapbox account page.
If you don’t have a Mapbox account, sign up with your email address.
Copy your Mapbox Access token from your account page .
Back in Power BI, go to the Format panel and find the Viz Settings option. Paste your access token in the Access token field.
You will see your first map visualization!
With the Mapbox Visual for Power BI, you can change the map style used in your visualizations. You can use any Mapbox default style or create a custom map style with Mapbox Studio. To update the map style:
In the Format panel, select Viz Settings > Map Style.
Select from any default map style. This example uses the Mapbox Satellite style.
Custom map styles
You can use any custom map style from your Mapbox Studio account by selecting Custom style. This is useful for adding custom polygons, drone imagery, or finely-tuning the context and design of your Mapbox visualization to help answer your business question.
When you select Custom style, you will be prompted to add a style URL. To learn how to find your custom style URL, read about more about style URLs .
To learn more about creating custom map styles in Mapbox Studio, explore the Mapbox Studio manual or the Create a custom map style tutorial. Have questions on how to implement these features? Reach out to our support team .
Now you'll see your data on top of a satellite map.
Next, you'll adjust the visualization to illustrate where the average covered costs are lowest in the US using a cluster layer.
In the Fields panel, add the Avg Covered Charges field from your data to the Cluster shelf.
In the Format panel:
Turn the Cluster layer On and the Circle layer Off.
Under Cluster, select maximum from the Aggregation type drop down list.

Images Powered by Shutterstock