Locked lesson.
About this lesson
Working with maps can be a bit tricky. This module will explain the good, the bad and the ugly of maps, as well as provide recommendations to avoid the ugly.
Exercise files
Download this lesson’s related exercise files. You can download the source data files for the course from the resources section of your Lessons page.
Maps & Filled Maps.pbix455.8 KB Maps & Filled Maps - Completed.pbix
456.1 KB
Quick reference
Maps & Filled Maps
Working with Maps and Filled Maps in Power BI.
When to use
Use to show your data and how it relates to location using either point maps or filled region maps.
Instructions
Working with the Map visual
- Use either the Location or the Latitude and Longitude
- When using Latitude & Longitude on your map, change to Don’t Summarize if it aggregates
- Separate data using the Legend Field
- Change point size by dragging a measure into the Size area
- Color saturation and tooltips are also available
Working with the Filled Map visual
- Must use a Location field
- Use a Country if necessary to get your data in the correct place
- Add Lat/Long to add precision
- Legend, Color Saturation and Tooltips are also available
Hints & tips
- If you are not connected to the internet when Power BI Desktop opens, the maps will not render
- Use Longitude and Latitude wherever possible as it provides much more accurate data
- If you must use a location field, aggregate one that includes “Street, City, State, Country” to try and get better results
- There is also an ArcGIS map which is very robust, but very complicated. Unlike other visuals, the ArcGIS map is customized via the … command in the top right corner of the visual (click Edit)
Login to download
- 00:04 In this video we're going to look at two of Power BI's maps.
- 00:09 We're going to look at the regular map visual as well as the filled map visual.
- 00:15 Now there is another visual that is currently in Power BI called ArcGIS maps,
- 00:20 this is a very, very complicated mapping visual.
- 00:23 We could do an entire course on this, so
- 00:25 I'm not gonna dig into this particular one.
- 00:27 I'm gonna start, though, with the regular old map.
- 00:31 Now the regular map, one of the big,
- 00:33 big pieces that you really wanna focus on here if you can possibly get it,
- 00:37 is you really want to use latitude and longitude for your mapping points.
- 00:43 And if you ever find that this actually says sum of latitude or something like
- 00:46 that, click the box here and change to make sure that it doesn't summarize.
- 00:50 You can't use an average or a max of latitude or
- 00:53 longitude in order to make this work.
- 00:55 So I'm gonna put my lat and my long in here.
- 00:58 And you'll notice that immediately, I actually see
- 01:01 the three data points from my location's table that are actually being mapped here.
- 01:05 And one big key here,
- 01:06 you must be connected to the Internet before you actually start this process.
- 01:10 If you're not, your maps will never render.
- 01:13 Even if you connect to the internet later, and you try slicing and dicing stuff,
- 01:16 your maps just won't show a visual, which is really unfortunate.
- 01:19 So make sure you're connected to the internet before you open Power BI.
- 01:22 You can use a location field by going into the power query editor and edit queries.
- 01:31 You can aggregate things like the street and the province and the country and
- 01:35 whatnot in order to try and
- 01:36 get all of that stuff into a nice little text stream that can be mapped.
- 01:40 One thing I will tell you is that, especially if you are outside the US,
- 01:43 the results that you get are very hit or miss.
- 01:45 This uses the Bing mapping engine and I have seen
- 01:49 all kinds of weird stuff happen with this, that get people very frustrated.
- 01:53 So if you can get longitude and latitude for your data, do it.
- 01:57 If you can't, well, then you may be resorting to going back and
- 02:00 actually merging columns together to doing that.
- 02:03 Now this is cool and everything else.
- 02:05 We can see our three data points.
- 02:06 It wouldn't be nice if they were a little bit bigger?
- 02:08 Well, sure.
- 02:09 So what if we did this?
- 02:10 What if we actually went and said lets make them bigger, but
- 02:12 in proportion to the sales dollars.
- 02:15 So I am gonna drag the size right on there and
- 02:18 notice now this doesn't tell me that this is this much bigger than the small dot.
- 02:23 What it tells me is that this is 1.5 million is the smallest,
- 02:26 this one here is 1.8 million and this one here is 1.81 million.
- 02:31 So these two are pretty close to the same size.
- 02:33 So really, it's not a perfect gauge to say this is the exact size,
- 02:38 but it does give you something to say which are my bigger data points and
- 02:41 which ones are my smaller ones?
- 02:44 We can also go and do some other things with this as well.
- 02:47 Something else that becomes really useful with maps is
- 02:50 when we start looking at this, we see, okay that's sales,
- 02:52 I can see the longitude and latitude, but what location name is that?
- 02:55 But why not do that as we drag location name and we'll put it on tool tips.
- 03:01 And you know what, what were there, why don't we grab budgets?
- 03:04 And put this on the tool tips as well and why don't we grab something like I dunno,
- 03:09 how about the sales units and put that on tool tips, lots of things here.
- 03:13 And now when I mouse over one of these little boxes,
- 03:16 you can see that the location is ethical development.
- 03:19 We can see that it's got a budget of 1.8 million.
- 03:22 Maybe I don't want this called first location name, though.
- 03:24 That's kinda gross.
- 03:26 Can I go back and rename this to just say location?
- 03:33 Absolutely.
- 03:34 So that looks much better.
- 03:36 Now that's the regular map visual.
- 03:37 There's a couple of things we can play with, color saturations and whatnot, but
- 03:41 overall I think you get the idea of how these things work.
- 03:44 Now I wanna show you the field map.
- 03:46 So let's grab the field map.
- 03:48 Now the field map starts with a location field as well.
- 03:51 So you know what I'm gonna do is, I'm gonna go back to my location stable and
- 03:56 I'm gonna say, why don't you show me the field map?
- 03:58 Let's fill my province British Columbia.
- 04:00 So this is British Columbia, Canada.
- 04:02 And you can see that when I drag that on, it plainly maps British Columbia, Canada.
- 04:07 No, wait it minute, no, it doesn't, that's Baja California,
- 04:09 what the heck is going on with that?
- 04:11 So this is a challenge, right off the bat you can see that BC, which is
- 04:15 pretty much known as our province is mapping to somebody completely different.
- 04:20 That's a challenge.
- 04:21 So how do we fix that particular problem?
- 04:24 Well, let's go and drop City underneath Province.
- 04:27 It doesn't seem to make any difference, and
- 04:29 yet, if I drill down on Baja, guess what?
- 04:33 It comes back in Vancouver, British Columbia.
- 04:35 This is just weird, okay, but it is something that ends up happening.
- 04:38 So let's go and drill back up here and see if we can fix this little problem.
- 04:42 If I had a country field above this,
- 04:44 if I started with Canada and then went into BC it would work.
- 04:48 Okay, so that's something that would work.
- 04:50 The other option that I have here, is that I can also go and grab, say a latitude.
- 04:55 Look at this, it's giving me an Average of Latitude, that's not so good.
- 04:59 So let's go fix this too.
- 05:00 Let's classify this data actually.
- 05:01 I'll go back to my data table, I'm gonna find my locations table,
- 05:06 and you'll notice here that I have latitude and on my modelling tab,
- 05:11 it's classified with the data category of uncategorized.
- 05:15 I'm gonna change this to be Latitude.
- 05:19 I'm gonna go to long and I'm gonna change this to be Longitude.
- 05:24 And now we're gonna go back over to our visual.
- 05:27 Now it hasn't changed anything here, but I'm gonna remove this average of lat.
- 05:32 We're gonna bring the Latitude back in, it still gives me the same thing.
- 05:35 Okay, it doesn't seem like there's much difference although it's using globe
- 05:38 instead of a number.
- 05:39 Let's put the Longitude on and that changes things right off the bat.
- 05:44 Now it actually puts it back in the right place, so again, Latitude,
- 05:46 Longitude you know information is really usable.
- 05:48 Having said that, if you just had country province city in your hierarchy,
- 05:52 that would allow you to actually get the right thing as well.
- 05:55 So I can drill in now into this particular data point.
- 05:58 And you'll notice that if I were to zoom all the way into Vancouver,
- 06:02 it actually highlights the region for Vancouver.
- 06:04 Now I'm not gonna go too much deeper with this particular map only because this one
- 06:08 really shades regions.
- 06:09 And it doesn't get too much more granular than getting into the city level.
- 06:13 Some post codes work for some things.
- 06:15 It doesn't for the Canadian data, though.
- 06:16 I can tell you that for sure.
- 06:18 So that's a challenge.
- 06:20 This is a different way of working with maps.
- 06:21 If you've got lots of regions, it can actually work out quite nicely.
Lesson notes are only available for subscribers.