We’re often asked in our Melbourne Power BI trainings to elaborate on the concept of selecting the best Map visual. So, we started an archive to guide Power BI users in this regard. Here is the link to the blog series covering all such problems: https://powerbitraining.com.au/category/creating-maps-in-power-bi/
A Power BI map is an excellent method to display data that represents different regions. Your consumers will be able to obtain a deeper understanding of your data by using aesthetically appealing maps and compact data formats.
Bubble maps are visuals that visualize a certain measure value on the map where the size of the bubble is directly proportional to the measure of the value and the number of bubbles signifies different locations in the dataset.
But how do you make and use Bubble map in Power BI?
Power BI Bing Maps can be created using either the location as a string value or using the values of longitudes and latitudes. This blog post is a complete guide for creating a Bubble map using two different 4-step methods in Power BI.
As Bubble maps require spatial data for their correct usage so let’s find out how to make the right data set for Bubble maps.
Two easy ways to create a Bubble map with four simple steps in Power BI Desktop
What is Spatial Data and Geo-coding?
Maps are supported in Power BI for a data set containing spatial features. These features include any information related to the location such as longitude, latitude, zip, City, State, etc. These properties can be converted into easy-to-understand graphics using Power BI’s Map Visuals. This method is also known as geocoding.
Let’s Start Exploring Our Dataset
Let’s look at the data set we will be using in this blog.
The data set used for this Blog contains information on sales figures across 11 states in the United States of America as shown in the figure below. The data set also contains records for a value measured (for example Units Sold) at a particular location. The value of this quantity governs the size of bubbles formed on the map.
Mistakes That Must Be Avoided While Working with Spatial Data:
It might seem easy to create map visuals just like any other visual in Power BI Desktop by dragging and dropping the required fields to the targeted values, but this may land you in trouble.
So, there are a few mistakes that you must avoid when working with spatial data.
Before you can start working with the map visualization:
• The data must be transformed.
• The data types must be set
Visit this blog for a detailed and step-by-step guide on how to entirely avoid making these mistakes: https://powerbitraining.com.au/mistakes-in-spatial-visualization/
Method # 01: Using the Location Column.
Download the blank Power BI file from this link https://powerbitraining.com.au/two-easy-ways-to-create-a-bubble-map-with-four-simple-steps-in-power-bi-desktop/, in this file we have already loaded the dataset. Now, follow the below steps to make an interactive Bubble map.
1. Check the City checkbox from the “Spatial Data – USA” table in the Fields pane on the right side of the window.
Please make sure that the “Spatial Data – USA” dropdown is expanded to see this checkbox.
2. Power BI will automatically generate a Map Visual.
But notice that the visual is showing some points outside the USA in Europe, Australia, South America, Asia, Africa, and Canada, to tackle this problem you need to perform the below four simple steps.
Data Transformation Needed for Accurate Mapping:
To ensure accurate mapping of points, data must be transformed to provide a complete address for each location.
To transform data, open the dataset in Power Query editor.
Step # 1: Change Data Type for Zip.
1. Click on Zip. Click on Transform > Data Type > Text.
A pop-up menu appears. Click on Replace Current.
Step # 2: Add a New Column.
2. From the Ribbon Menu, click on Add Column and then from the General Section, click on Custom Column.
A pop-up menu appears.
Step # 3: Type the Given Formula.
3. In the New Column Name, type “Location”. And then type the following formula in the custom column formula section. Then click Ok. And close the Power Query Editor.
A new column containing the complete address of the location points is created.
Step # 4: Drag the Location Column To Location Value.
4. Now Remove the City Field from the Location value in the visualization section. And drag the newly created Location column to the Location value.
Now, all the locations have been correctly mapped to the United States.
Also, Drag and Drop the Units Sold field to Size value which will decide the Size of Bubbles.
Method # 02: Using The Values of Longitudes And Latitudes.
Setting appropriate Data Types for Spatial Data
Power BI does not recognize spatial data types by default. Therefore, data Types must be adjusted before we formally begin to visualize our data.
Bubble Maps can be created in Power BI using the Map Visual that uses Bing Maps to visualize Spatial Data. Bing Maps is a web mapping service provided as a part of Microsoft’s Bing suite of search engines.
To completely follow the steps below, add another page in the Power BI Report that you downloaded earlier and rename it to “Method 2”.
To set Data Types:
1. Click on Longitude in the Fields pane.
2. Click on Column tools in the ribbon.
3. From the Properties section, click on Data Category.
The default value for the data category is uncategorized.
4. Click on Longitude from the drop-down.
5. Click on Default Summarization > select Don’t Summarize.
6. Click on Latitude in the Fields pane.
7. Click on Column tools > Data Category > Latitude from the drop-down.
8. Click on Default Summarization > Don’t Summarize.
9. Click on Zip in the Fields Pane.
10. Click on Column tools > Data Category > Postal Code.
Selecting the Map visual:
To create a Bubble Map using Bing Maps, Select the Map Visual from the Visualizations pane.
Pulling in the Correct Data Fields:
Now that the visual has been selected, it is time to populate the visual with the correct fields.
To do this:
Step # 1: Identify The Column Containing Latitude Values.
1. Drag and Drop the Latitude field to Latitude value.
Step # 2: Identify The Column Containing Longitude Values.
2. Drag and Drop the Longitude field to the Longitude value.
Step # 3: Identify The Column Whose Values Will Be Used To Decide The Size Of Bubbles.
3. Drag and Drop the Units Sold field to Size value.
Step # 4: Label Different Regions With Different Colors To Distinguish From One Another.
4. Drag and Drop the State field to Legend value.
A map is created where different states have been allotted distinct colors. The size of the circles represents the value of units sold at that location.
Significance of Bubble map!
In addition to improving the localization capability of map plots, Bubble map can also provide significant information. To clearly look at the varying sizes of Bubble map based on Units Sold apply the Basic filtering on State in the filters pane and select New York.
Create Pie Charts for the Bubbles!
To completely follow the below steps, add another page in the Power BI Report that you downloaded earlier and rename it to “Pie Chart”.
To create the Pie Charts in Bubbles:
1. Select the Map Visual from the Visualizations pane.
2. Drag and Drop the State field to the Location value.
3. Drag and Drop the Order method type field to the Legend value.
4. Drag and Drop the Units Sold field to the Size value.
Formatting Options available with Bing Maps:
Power BI provides you with different formatting options which you can use to Customize your map visuals according to your requirements.
These options are available in the Format Tab inside the Visualizations Pane.
This option allows you to set the Size of bubbles.
This option is set to off by default but if it is toggled on then the Category Values are displayed on the map. If this option is toggled on, you will see the longitude and latitude values pointing at the mapped points.
If the location column is used to build a Bing map and the category labels button is toggled on, then you can see the names of locations on the map.
Map Controls allow you to customize the zooming capabilities of your report visual. Setting the toggle button for Zoom buttons creates two interactive buttons on the map that allow you to drill down or drill back to different levels in map.
Map styles provides you with a drop-down menu where you can use Different Styles to change the visualization style of your map. For example, if you choose Aerial from the drop-down menu, an Aerial view for the map appears.
When to use a bubble chart ?
- A bubble map is frequently confused with a scatter plot; however, the scatter plot can only show a comparison of two variables, whereas the bubble map can illustrate a relationship between more than two variables.
- It is easy to create and understand a bubble map with Power BI.
- If a scatter map contains so many points in a region that their number is difficult to see, we could replace them with a single bubble that reports the entire number of points in the region.
- In Power BI hovering over each data point and reading the tooltip is the key benefit.
Maps are important when you want to visualize spatial data. Maps are the only visual that can be used to visualize spatial data. This data must be transformed to make it fit for accurate mapping. Bubble maps help to visualize the magnitude of values by the size of bubbles. Bubble maps can be constructed in four simple steps.
To download the complete Power BI Report, click on this link
Are you a data analyst and want to learn more about Power BI?