Creating Shape Maps In Power BI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] welcome to building shape maps in power bi shape maps like the one we see in our screen or geographical maps and they split into areas and each area has a shade or a color associated with a particular category in this case we're looking at the UK election results in 2019 we split the UK into 650 shapes each shape is a constituency and we used the color of the winning political party shape maps can also encode the value of a numerical variable for example in this visualization here we see the local authorities of England and the shading refers to the number of cases of covered 19 at speed-dating time shape maps can also encode a kind of group number like we see here we're looking at a couple of local authorities in South London and we're looking at a kind of socio-economic number called the IMD index of multiple deprivation and we're looking at Croydon and Lambeth and what we can see if we want to click on a bar chart underneath it we can see the areas that are most deprived and the areas that are at least deprived enough introduction let's get started we're going to show you how to build the perfect shape map with a power bi shape visual in ten easy steps step one shape maps need a shape map visual in the palette here it is there are other maps as well the Bing Map standard build map a filled map and an ArcGIS map now if you don't see the shape map visual that's because it's a preview future and we have to go and switch it on go to file options and settings options choose preview features and the shape map visual is right at the top here step to shape maps and each shape files and a shape map visual has a few inbuilt ones put it on to the canvas I'm going to take country name and put that on to my location I'm going to take my cases and put that on to my color saturation and we get this map of the United States by default but we can come along and say actually the shapes I want to use or UK countries notice the list of shapes that's it there's not that many and now I've got my first shape map visual step free for the UK this website in the comments below has got lots of great shape files that we can use so for example I'm going to go into the electoral boundaries and go to Westminster parliamentary constituencies and get the latest boundaries this gives me a list of files and I'm going to the file which is the smallest file which is this B you see ultra generalized file I click on that that will give me the file and I can download it as a shape file and that will create a zip file on my folder I'll just save that step for while we're downloading the shape file we can also download a spreadsheet file this is actually a CSV file and if we open it it's got lots of useful information not necessary for the shape map itself but if we want to do a corresponding point map it's got the codes and the names of what the Westminster constituency is and it's got the longitude and latitude to position them step 5 the shape file that we downloaded from that website of Westminster parliamentary constituencies is in a format called ESRI format and that's not the former that we need for power bi it needs something called topo Jason but what we can do is use this wonderful online tool called map shaper and we can just drag the files onto there that's the shape files and then import them now let's check the projection of the map I'm going to click on console here to bring up this window and I'm going to go to info and this tells me that the projection is not what I need power bi needs a projection of wgs84 so we can change that we can just type in this commands proj wgs84 it seems to flatten it but another info will tell us that we've now got the right projection if you don't use this projection your power bi shape map will look like a child scribble drawing so it's really important once we've done that we can come along and export the data and we're exporting it as a topo JSON file step six is to build that shape let's put a shape visual on the canvas make it a bit bigger and we're going to take constituency name from our UK election data and we're going to take majority and put it on add color saturation we get a standard US state map that's not will need we click on the formatting pane we're going to shape and we say add a map and the map that we want to shape is that JSON file of Westminster parliamentary constituencies and there we have our map stem 7 our constituency name the field in our location field has got to be have exactly the same values as the map if we have a look at the map shape we can see it's got some keys and there they go it's got the keys for the name and it's got the keys for the code we can see that this problem with angle C because it's in gray if i zoom on it and we can have a look at the name here it's got that circumflex accent on the final oh if we have a look at the data the name hasn't got that and that's why they're different that's why it's not showing fortunately for us what we can do is go to our field well and use constituency ID because the codes those standard codes to agree we can see that now angle C is shaded in properly might want to take our constituency name now put it on tooltips so we get a good tooltip for that as well step eight is that we can change the default formatting of the color scale and what I'm going to do is just choose a different format saying this doesn't give any indication my political affiliations I'm just choosing a different color to the blue and there we go we can choose a different color scale I've chosen a sequential color scale in this case because it's the majority maybe it would be actually good to make the the minimum why cuz that would be zero and that's probably a better definition distinction step nine is to shade in our map in a more controlled way I've just created a new column in my UK election table is called majority margin and I've written a tiny bits of code what we're doing is creating a column which has four values from low to high very high depending on the size of the majority what I've done as well is I've taken the majority margin and I've put it into my legend and that gives me over here it gives me the legend we can see that and the next thing that I've done is I've gone to my color Brewer and I've chosen a palette and a purple palette and I've chose the sequential palette produces kind of margin of low-to-high with four classes and I've taken these four hex codes and I put them into the values for my I'm show you them there we go hi if I look at the hex code for that that is a hex code that came out to kelabra so I've chose chosen kind of four colors that should be quite far apart as possible stem ten our colors don't need to represent a number or even a banded number as we've just done what I can do is I can take the party and put it on the legend and what I get is a set of distinct colors one for each party now these are not the official party colors but of course what we can do we can go into the data colors and we can provide the official party colors there's a lot more to be said about mapping and we'll come back to it in future sessions so for example the screen here shows the same IMD data as we saw before but not just for a couple of boroughs in South London for most of South London and we're using a different sort of visual not the shape map visual but a map box visual one of the custom visuals in power bi so we'll come back and look at that in detail in future sessions I hope to see you that bye [Music]
Info
Channel: London Business Analytics Group
Views: 17,355
Rating: 4.9698114 out of 5
Keywords:
Id: YV6y1pX0-hg
Channel Id: undefined
Length: 9min 36sec (576 seconds)
Published: Wed May 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.