We have declared October to be mapping month! This month, we will focus on maps and geospatial data. There are several different maps available in Power BI as default and custom (AppSource) visuals. This week we are going to give you a fairly simple challenge that will show you some features of Power BI that you may not have known about when it comes to mapping.
Last week we used Power Query to geocode locations, accepting a city as input and returning longitude and latitude as output. This week we are going to be exploring how to implement custom maps from Mapbox into Power BI. If you aren’t familiar with Mapbox, it is a tool that allows you to edit and modify almost every aspect of your map (labeling, colors, boundaries, etc). It is a super powerful tool, but in this challenge we are just going to focus on the simple task of integrating it with Power BI.
- Load the Superstore data set from data.world
- Create a custom column in both the LatLong and the Orders table called City State that combines the City and State fields to allow for a relationship between those two tables
- Add the custom visual Mapbox Visual from the AppSource
- Go to Mapbox.com and create a free account. You will need to create an access token to use Mapbox Visual maps
- Create a map using the Map Style of your choosing.
- Additional Challenge: You can made a custom map in Mapbox and bring it into Power BI by choosing Custom for Map Style and pasting in the Style URL
- Create DAX calculation for profit margin using the Profit and Sales fields
- Create map that shows each City and State colored by the Profit Margin and then sized by the absolute value of the profit margin. Adjust the ranges of the size and colors to -100% to 100%.
- Create a bar chart that shows Profit Margin by Region. Allow the bar chart to filter the map as well as be able to drill down into State so that you can also filter the map by State
This challenge uses data provided on data.world that we have used in a previous exercise. You can use the data.world connector in Power BI (recommended) or download the Excel file to your local machine. You will need to log in to data.world to retrieve the data, but accounts are free.
After you finish your workout, share on Twitter using the hashtags #WOW2021 and #PowerBI, and tag @JSBaucke, @MMarie, @shan_gsd and @dataveld. Also make sure to fill out the Submission Tracker so that we can count you as a participant this week in order to track our participation throughout the year.
2 thoughts on “2021 Week 41 | Power BI: Mapbox Maps”
Thank you for introducing me to MapBox!