Power BI Maps Tutorial

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:

Unemployment Rate

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:

Power Bi Get Data

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.

Power Bi Preview Connector

After that, the DataWorld.Dataset connector is opened, where we must enter Owner and Dataset ID:

Dataset

These elements can be found in the dataset webpage: Click Download and then Connect to third-party apps:

Connect To Third Party Apps

Next, we click Power BI:

Click Power Bi

 

Which opens a new dialog:
Power Bi Dialog Box

Here we can see the Owner and Dataset ID that we need. We copy/paste this to our connector in Power BI:
Pbi Dataset Connector

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:
Power Bi Connection Establish

We will load the all_years_months table, and will have the same columns as we initially saw in the Data World site:
All Years Months Table

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.
Power Bi Irrelevant 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😐
Power Bi Text Before Delimiter

We see that City is separated by a comma, so we put a comma in next dialog:
Power Bi City

After we click OK, we will have a Text Before Delimiter column that represents City:
Text Before Delimiter Column

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.

Power Bi From Selection

We write AL in the first row and then Power BI will automatically detect that we need Text Between Delimiters:
Power Bi Al

We click OK and rename this column to State:
Power Bi 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:
State Visual

Same things happen if we click City, a new map visualization will be created, showing city locations:
Power Bi City Locations Map

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:
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:
Power Bi Hierarchy

Which will show the average unemployment rate by City:
Power Bi 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:
Power Bi Turn On Drill Down

For example, California:
California

Texas:
Power Bi Texas Map

Or Florida:
Power Bi Florida

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:
Power Bi Month Slicer

If we now click in the Slicer items, the Map will be updated showing only the values for the selected month in the slicer:
Power Bi Slicer Items

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:
Power Bi Formatting Options

We can change the color of bubbles:
Power Bi Bubble Color

Or we can select to change every bubble color individually:
Power Bi Individual Bubble Change

Next, we can play around with the Category Label:
Power Bi Category Label

We can make the bubbles bigger:
Power Bi Bigger Bubbles

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.
Auto Zoom

Next, we can select a map theme:
Power Bi Map Theme

We see that the default option is Road and we can easily switch to other themes:
Power Bi Alternate Themes

Power Bi Alternate Themes 2

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:
Power Bi 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.
Power Bi Change Data Colors

And so on, just as in the Map visual.

We can also use custom visuals from the marketplace:
Power Bi Custom Visuals

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.

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. 

 

The post Power BI Maps Tutorial appeared first on Jet Reports.

Bitnami