In my recent post on UK Postcode mappings for powerBI I showed how you can create a map for the UK Regions to display your data. In this post, we’ll go down a level and I’ll show you a mapping of individual postcode area to the UK Map.
First, we’ll need to enable a preview feature (as of publication) of powerBI called shape maps. To do this just head to the options and settings in powerBI and tick the “Shape map visual” box, then restart powerBI.
The shape map lets you use TopoJSON files to create custom maps, much like the synoptic designer custom visual from my previous post, in fact recreating the region map as a TopJSON might be a more elegant solution. For this map, I used a shape file from this company who have put together a data source for the postcode geometries. I converted this to a TopoJSON using mapshaper and loaded this up as a shape map. For the demo I’ve just assigned random numbers between 1 and 100 to each region, but as you can see the map looks great 🙂
They also had geometries for the individual postcode districts, meaning you can drill down even further (not exactly drill down like in Bing maps, as that feature isn’t part of the shape map vis yet). Here is the map of districts:
You can however filter down into individual postcode area’s, using the first map as a slider to filter the second map by creating a relationship between the two assignment tables. Create the relationship by adding a column in the district table and linking it to the area table:
Then you can click on regions of the area map to filter the down the district map to postcodes districts in that area. Try it out on the embedded report below:
For more information about postcode assignments and the other map visualisation in powerBI, see my previous post here. As always, if you have any questions feel free to comment and I’ll do my best to get back to you.
If you’d like to use the TopoJSON file for your own work, head over to Open Door Logistics downloads page, where the data came from. Dr Phil Welch has graciously agreed to host the files there for anyone to use internally, check out the license details here.