Power BI Maps Tutorial
In this post, we will use Power BI Maps to visualize data. As a sample dataset, we will use the Unemployment Rate by City dataset that can be found in Data World site under the link:
https://data.world/garyhoov/unemployment-rate-by-city
The data is organized as in the following screenshot:
We can see that there is an “Area” column, which we will use to create Map visuals.
As a first step, we need to connect Power BI to this dataset. Recently, Power BI Desktop introduced a Data World Connector that enables connection with datasets stored in Data World site:
As we can see, this connector can be found under the Online Services menu.
Once we click connect, the Preview connector warning is opened. We click Continue.
After that, the DataWorld.Dataset connector is opened, where we must enter Owner and Dataset ID:
These elements can be found in the dataset webpage: Click Download and then Connect to third-party apps:
Next, we click Power BI:
Here we can see the Owner and Dataset ID that we need. We copy/paste this to our connector in Power BI:
After we click OK, we will get the dialog to log into Data World with our account.
We can use OAuth v2 or API token options. Sometimes, the OAuth v2 authentication throws an error so we need to use the API token option. The API token can be found in Data World site, after we log in of course, under: Profile >> Settings >> Advanced >> Read/Write API token.
After we do this, the connection will be established:
We will load the all_years_months table, and will have the same columns as we initially saw in the Data World site:
Now we can start to explore our dataset. We see that the Area column contains City name combined with state abbreviation and another abbreviation that is irrelevant for our sample.
Therefore, we must make some transformations before we can start creating map visuals. We must go to Power Query Editor and create City and State Abbreviation columns by using an Area column.
By having selected the Area column, we go to Add Column >> Extract >> Text Before Delimiter😐
We see that City is separated by a comma, so we put a comma in next dialog:
After we click OK, we will have a Text Before Delimiter column that represents City:
We will rename this column City.
To extract the State abbreviation, we will use another significant Power BI feature – Column from Examples. We select the Area column and then choose Column from Examples >> From Selection.
We write AL in the first row and then Power BI will automatically detect that we need Text Between Delimiters:
We click OK and rename this column to State:
Now we close and load data.
If we just click State, Power BI will automatically create map visual, having state values in the State column:
Same things happen if we click City, a new map visualization will be created, showing city locations:
Let us now explore Unemployment Rate. We will create a map visual with State and City in the Location field and with Sum of Unemployment Rate in the Size Field:
We see how the map is created, with bubbles pinned to States, where bubble size represents the Average Unemployment Rate, the bigger the bubble, the bigger the Unemployment Rate in that state.
Since we have created a hierarchy State – City in our visual, we can use drill-down options just like with other types of visuals. For example, we can click the button in the middle to go to the next level in the hierarchy:
Which will show the average unemployment rate by City:
Or we can Turn on Drill Down and then click in State bubbles to explore unemployment rate by City in only one State:
So, we can easily navigate and explore data for every state that we are interested in.
Of course, Map Visual can work in combination with other visuals. Let’s see this by adding a Month Slicer and a Line chart showing the Average Unemployment rate by year:
If we now click in the Slicer items, the Map will be updated showing only the values for the selected month in the slicer:
We can see that Map is a very nice visualization that makes Location data very attractive to work with.
Let us now see the different formatting options that are available for this visual:
We can change the color of bubbles:
Or we can select to change every bubble color individually:
Next, we can play around with the Category Label:
We can make the bubbles bigger:
Then we can choose to turn off the Auto Zoom option, so the map will stay as we set it up once and it will not zoom automatically based on our selections. If we turn this Off, then the zooming can be done using mouse scroll.
Next, we can select a map theme:
We see that the default option is Road and we can easily switch to other themes:
And there are common options like Title, Background, etc.
Now we will see other types of Map visualizations available in Power BI. We can easily switch from one type to the other by just clicking the visuals. Here how it looks with Filled Map visual:
The darker the color, the bigger the size of the Unemployment Rate. We can customize the appearance of this visual too. For example, let’s change the Data Colors.
And so on, just as in the Map visual.
We can also use custom visuals from the marketplace:
Not all of these can be used in our case because some of these require Latitude and Longitude values as inputs, which we do not have in our dataset.
Now you have the tools to build robust Power BI maps with much more functionality.
View more Power BI Tutorials at www.powerbitutorial.org
Jet Reports is dedicated to giving you better data for your Power BI projects. Learn more about how Jet Reports serves as the engine behind Power BI, and how it can save you time, money and resources.