MAPS! MAPS! MAPS!
special thanks to Sufyan Katariwala and Zack Finer for helping put together this post.
You can lead an analyst to data, but…
Secondary to pie charts, maps are one of the most frequently misused data visualization components. While the notion of adding geographical context to data sounds appealing in principle, without a strong use case or proper configuration, the end result can be underwhelming at best, oftentimes gaudy and confusing.
Traditionally, PowerBI’s native maps using Bing has fallen short of expectations. While ArcGIS has been the dominant Veteran in the mapping space, MapBox’s new integration (March 2018 update) with Power BI offers a strong, user-friendly, fast and offline-accessible way of using custom map layers.
Before jumping into the new MapBox integration, let us review what defines a strong use case to leverage maps in Visualizations:
Now that we have identified what constitutes a good use case for a map, let’s explore how to setup and configure MapBox and PowerBI to drive insights.
1. Setup a MapBox account (link)
a. In order to use the MapBox widget, you will need an API Access Token, which can be generated using a free account
b. The free account lets you make 50K calls (views) per month
2. Import the MapBox visualization from Marketplace.
3. Drag the Mapbox Visualization on the dashboard and add your Latitude and Longitude measures to the visual. Also, add the measure to the color for which would you like to capture the density.
a. From your browser, log into your MapBox account and copy the access token provided in the account settings. Paste this token under Format < Viz Settings < Access Token
b. If you want to use a custom Layer that you developed, copy and paste the applicable URL for it in the same section
4. You should now be able to view the map layer in the visual. In order to customize the map layer, head over to your Mapbox Design studio and get cranking.
a. We won’t cover how to design and customize your map layers in MapBox studio but you can refer to this link if you need any help getting started.
b. You can customize the cartography, fonts, density and zoom layer in the design studio. You customize the level of detail displayed & colors on the map based on the level of zoom on the map!
5. The MapBox visual in PowerBI allows you to use Heatmaps, Clusters, and markers all on the same map. Configuring the visual to leverage this ability will be essential to a useful application of the map.
6. For this example, we are working with data regarding the average sales price by Zip code for the state of California. At a heatmap level, we can quickly visually see which regions of the state have higher prices and as we zoom in further, we can see which zip codes within the region drives that behavior. The dynamic legend allows you to flexibly zoom in and out and still capture the most important information (HeatmapàCircles)
7. Note: The desired configuration will vary depending upon the size of the visual, dashboard and level of detail of marks on the dashboard. Please use this as a guide, test and adjust as necessary.
8. Heatmap Configuration:
9. Before we start customizing, ensure the circle, Heatmap and Cluster setting is set to ‘off’ [Starting with a clean slate]
10. Turn on the Heatmap Layer and configure it as follows:
a. Set Radius to 5
b. Set Intensity to 0.2
c. Opacity to 100
d. Set your Min-Mid-Max colors as desired (Pick colors that don’t completely blend into each other)
e. Set Min Zoom to 0 and Max Zoom to 8 (This will configure the Heatmaps to display up to a certain zoom Level)
11. Turn on the Circle Layer and configure it as follows:
a. Set Radius to 1.5
b. Zoom scale to 10
c. Set your Min-Mid-Max colors similar to the heatmap layer
d. Set Min zoom to 8 and max zoom to 100. (whenever zoom level exceeds 8, it will which this layer)
This basic configuration should allow you to get started and you can tweak and modify this based on your use case. If you’d like to include the third layer, enable clustering and configure it to sit between the heatmap and circle layers. The customizations are endless on the MapBox studio side — even the default map layers offer a great alternative to the original filled map visuals.