Some ideas for how to map data in Power BI Desktop
Part five of a five-part series of blogs

Anyone who has tried to get a meaningful non-US map out of Power BI Desktop will know that it's often not straightforward! This blog shows you how to overcome some of the issues, including geocoding data, getting latitude and longitude settings and changing cross filter settings in relationships.

  1. Techniques for creating maps in Power BI Desktop
  2. Starting the map
  3. Geocoding (setting the correct localisation for data)
  4. Obtaining latitude and longitude data
  5. Using latitude and longitude data to create a map (this blog)

Posted by Andy Brown on 08 June 2017

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Using latitude and longitude data to create a map

This should be the end of this blog.  You should be able to add the Latitude and Longitude fields to your field well as follows to create the final map:

Latitude and Longitude fields

Add the fields as shown, and make sure you're averaging each (adding latitudes together within each region wouldn't make much sense!).

Here's the resulting map:

The wrong map

Something has gone horribly wrong!

 

To solve this, return to your relationship view and double-click on the relationship joining the centres to their latitude/longitude settings:

Postcode relationship

Double-click on the relationship to edit it.

Most of what you see is good:

Relationship details

The relationship is joining the correct columns by the correct fields.

However, you need to change the cross filter direction at the bottom right of the dialog box to Both:

Cross filter

Change this setting to Both.

The problem is that because the Lat and long table was the primary table for the relationship, including the region in a map didn't allow data to flow the other way.

And hey presto, we have total sales appearing in the correct geographical regions!  I've added a bit of formatting too:

The final map

Because each purchase is tied to a shopping centre, and hence a town and region, and because we know the latitude and longitude setting for each shopping centre, the regions appear correctly on the map.

Phew!

This blog has 0 threads Add post