Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Follow the steps below to add an OS basemap:
Once logged in to the OS Data Hub website, select Data from the main menu, then select APIs > API Projects from the secondary navigation menu, then click the Create a new project button.
Within the OS Visual setting menu in Power BI, open the Visualizations pane and navigate to Format visual > Map Settings. The first entry of the Map Settings menu is an input text box called 'OS API Key’. Paste in your project API Key from the OS Data Hub into this text box.
Once your project API Key has been added, an OS basemap should render automatically.
If you want to fully zoom into the map, please make sure that the ‘Use Premium data’ toggle setting located beneath the OS API Key input box (in the Visualizations pane) is switched to On. If you registered on the OS Data Hub using a Public Sector Plan account (i.e. you are a PSGA Member), then there is no additional charge for using Premium data.
For non-PSGA Members using the free OS OpenData plan, please note that the maximum zoom levels will incur a cost as they are classed as Premium data. You should ensure that the ‘Use Premium data’ toggle setting located beneath the OS API Key input box (in the Visualizations pane) is switched to Off.
For more information on which zoom levels are OS OpenData and which are Premium data for the OS Maps API, please see the tables on the OS Maps API Layer and Styles page.
These instructions detail how to install OS Maps for Power BI Visual.
Installing OS Maps for Power BI Visual is straightforward and requires only a few steps. You should have received a link to Dropbox that contains a .pbiviz file with the name of your organisation on it. The .pbiviz file contains the visual that you'll import into Power BI.
After installing the visual, click the OS icon and add it to a report. When you add a visual to a report, you’ll be presented with a landing page:
Rendering a basemap requires an OS Maps API Key, available from the . If you already have access to the OS Data Hub, skip to the page; otherwise, sign up for access to the OS Data Hub using the instructions below.
For public sector customers (i.e. PSGA Members):
Register via the appropriate .
You’ll need to be invited by the administrator of your organisation’s OS Data Hub account. (It’s usually someone in your GIS / Geospatial Team.) If you can’t find your OS Data Hub Administrator or want to know their contact details, please contact or your OS Account Manager.
For individuals and commercial organisations:
Register via an to use the OS Maps API for free.
Please note that the maximum zoom levels will be capped for maps using the free OS OpenData plan. The maximum zoom levels will incur a cost as they are classed as Premium data. A Premium data toggle is present within the visual to control this, so you can choose whether to use Premium data or stick to free OS OpenData.
For more information on which zoom levels are OS OpenData and which are Premium data for the OS Maps API, please see the tables on the .
Users requiring maps without restrictions will require a Premium OS data licence. This can be acquired via an .
Follow the steps below to create a point map:
If your data has a list of postcodes or UPRNs (unique property reference numbers), then you’re able to plot these on a map by simply dragging and dropping the relevant column in your data into the Points: Postcodes or UPRNs field of the visual.
Postcodes are plotted according to their corresponding centroid.
The visual can display up to 30 000 individual points on the map.
Please note, if points appear on the same location, Points: pop-ups will have to be populated with a data attribute that splits out the points (see 'Adding clickable point pop-ups' on the Creating a point map using categorical data page).
If you have incorrect or out-of-date postcodes and UPRNs in your data, they won’t geocode as points on the map. Clicking on the notification panel (the bell icon in the bottom left of the Power BI UI) will let you know which UPRNs or postcodes failed to geocode and are incorrect.
More detailed information, such as how many postcodes / UPRNs the visual attempted to geocode and how many succeeded, can be found by clicking on the notification panel after turning on the 'Show more detailed messaging' toggle found under Format visual > Map Settings in the Visualizations pane.
If your data has a list of Longitude / Latitude or Eastings / Northings, then you’re able to plot these on a map by simply dragging and dropping the relevant columns in your data into the Points: X and Points: Y fields of the visual.
The visual can display up to 30 000 individual points on the map.
To see any errors, turn on the 'Show more detailed messaging' toggle under Format visual > Map Settings in the Visualizations pane.
If the fields won’t populate with your data, make sure that on Table View the data type for your longitude / latitude data is set to Decimal number and NOT Text.
The reference layer feature provides a way to consistently display polygons/boundaries (e.g. LSOAs, wards, etc.) regardless of how point data is filtered on the page.
This only works for ONS GSS codes and boundaries (e.g. W00008779). If custom geometry is required, then this is not supported by the reference layer.
The reference layer feature can be found under the Visualisations pane > Format Visual > Reference Layer Settings
For a reference layer to be generated, the relevant GSS codes need to be input into the ‘GSS Codes to add as map’ text box.
GSS codes can be copied and pasted directly from a spreadsheet into the text box, and it will automatically work.
Once the codes have been input, the visual should update after a few seconds with the relevant polygons displayed on the map as a reference layer that is not linked to any other data used in the visual.
This getting started guide provides instructions for using the OS Maps for Power BI Visual product. Users with limited technical knowledge will be able to follow this guide.
This getting started guide provides guidance on how to install and use the OS Maps for Power BI Visual. Topics covered in the guide include:
It’s possible to combine a point and a polygon layer on a single map. However, depending on your use case, the data model being used may need to be correctly formatted to make it work.
If your use case involves being able to filter point data but you need boundaries (polygons) to always display on the map, regardless of how the point data is filtered on the page, then see the .
If you need the polygons to also filter on the map then continue below.
For both points and polygons to be displayed on the map and also allow filtering based on user selections, both point and polygon data must come from the same data model. This can be achieved by either having both point and polygon data in the same data table or by using the Power BI data model view to link the data together.
Data can be combined outside of Power BI or by using built-in Power BI functionality –
If using Power BI’s data model view to relate data sets to one another, then the following Power BI help article may help – .
The visual has been designed so that clicking on a point or polygon on the map displays a pop-up with additional useful information about that location instead of filtering data in other visuals on the page.
The lasso tool allows you to filter the data on other visuals based on a selection taken from the map.
Categorical data is data that's divided into groups, such as age, gender, occupation, etc.
To create a map of categorical data, you first need to plot the data points on a map. The previous page, Creating a point map, provides detailed instructions on how to add data points to a map.
Once you have created a point map, drag the column in your data that contains the different categories into the Point: Colour field of the visual. The map will automatically recolour the points based on the different categories in your data.
Up to 12 different categories within your data are currently supported.
The only way to change the colour of categorical data (points and polygons) is by specifying the relevant colour hex code (for example, #cdf1f0) in the data and dragging the column of data that represents the colours to be used into the relevant Points / Features: Colour field in the visual. There is currently no way for you to customise the colours that are displayed for categories by default via the user interface.
Adding hex codes into your data to manipulate the point colours won’t update the category colours within the legend.
It’s quite common that you might want to vary the size (radius) of the points on a map to represent an increase in occurrence or density (for example, larger points represent a greater number of crimes at a location).
To do this, having plotted points on a map, drag a data column containing numeric data into the Points: Size field of the visual. Then click on the downward arrow of that field and select Count. Now the size of your points will be based off the total count of data points at the locations of your points.
You can combine the colouring of points based on categorical data and the size of points by another data attribute to represent two different variables in a single point within your data.
Point size only accepts a numeric data type.
See an example below showing a combination of categorical data (crime type) and point size variation (count of crime).
Additional information about a point can be displayed as a pop-up when a point on the map is clicked.
To add a pop-up to a point on the map, drag and drop data into the Points: Pop-ups field in the Visualization pane. Information included in the pop-up field should be shown when a user clicks on a point.
Multiple data columns can be shown under pop-ups.
By enabling point pop-ups based on different data attributes, points that appear in the same location can be filtered on the map (see screenshot below, where points can be filtered on the map by crime type data).
It’s quite common that points on a map will overlap, making the data more difficult to understand. For example, when considering crime data, a shoplifting crime and a violent crime may have been recorded to the same x, y coordinates; however, one point will be plotted above the other and will therefore obscure some of the data.
By dragging a relevant column of data into the Point: Pop-ups field, you can click on a point on the map to reveal a pop-up and then paginate through all the underlying points that were originally obscured.
Below is an example of a pop-up where data representing crime type is being used to enable pagination of overlapping points; the pop-up shows there are five points representing different crime types in the same location:
If you add a column of data containing textual data representing categories (for example, School, Library, Gym) into the Points: Colour field, the points on the map will automatically colour based on a default colour palette, and a legend will be generated on the map showing what colour represents what category (for example, School = Green).
However, the colours can also be customised by specifying hex codes within the data. The only way to change the colour of categorical data (points and polygons) is by specifying the relevant colour hex code (for example, #cdf1f0) in the data and dragging the column of data that represents the colours to be used into the relevant Points / Features: Colour field in the visual. There is currently no way for you to to customise the colours that are displayed for categories by default via the user interface.
It’s easy to create a choropleth (or fill) map using Office for National Statistics (ONS) geographies – Lower layer Super Output Areas (LSOAs), wards, etc. – in the OS Maps for Power BI Visual, without requiring a separate geometry file.
To make the following steps work, your data will need a column that includes ONS Government Statistical Service (GSS) codes.
GSS (Government Statistical Service) codes are nine-character alphanumeric codes which correspond to geographies that ONS supports, for example, an LSOA code looks like this: E01000917.
Examples of LSOA codes are shown in the table below:
E01000916
Camden 027B
E01000917
Camden 027C
E01000917
Camden 027C
E01000914
Camden 028B
To display these geographies as polygons on a map, simply drag and drop the column of data that has these codes into the Features Layer: GSS identifiers geocoding field of the visual.
Any incorrect codes won’t display a polygon on the map. The notification panel will display what codes did not work. Currently, the OS Maps for Power BI Visual does NOT support historic codes.
To colour the map and create the choropleth, drag the relevant column of data into the Features Layer: Colour field. This field can accept either numeric or text data. It’s important that every row within your data table has a GSS code (representing the polygon) and the relevant data to colour the polygon (numeric or text).
If using numeric data, then the Features Layer: Colour field allows several mathematical operations to be performed on the data (for example, Sum, Average, Count, etc.) to interpret it; these may need to be utilised to display the desired data correctly on the map.
It’s quite common that a report reader will want to view a defined geography (for example, a local authority such as Cardiff) but see data on the map that represents an underlying geography, such as wards. To do this, it’s important that the underlying data is structured in the correct way. Each row should have both the geography to be displayed on the map (for example, ONS ward code – W05001272) and the geography to filter by (the local authority that the ward code belongs to; which in this case is Cardiff). The data might look like the following table:
Trowbridge
W05001296
7 009
Cardiff
Whitchurch and Tongwynlais
W05001297
6 832
Cardiff
Allt-yr-yn
W05001627
3 989
Newport
Alway
W05001628
3 403
Newport
A filter can then be created to display the data, such as having a table listing the local authorities alongside the map. When a user clicks a local authority, the relevant wards and any associated data making up that local authority will be displayed on the map.
Once appropriate data has been dragged into the Features Layer: Colour field, then the map’s colours should update. To customise these colours, go into the Format Visual > Styling: Features Layer section.
If using text data to colour the map, then a maximum of 12 colours will be automatically generated. These colours cannot be manually changed.
By changing the Min or Max Feature Colours, the map colours will update based on the minimum and maximum values of the data used. Opacity can also be altered to style the map.
The Feature % Clip can be used to ignore outlier data points. It ignores the selected % minimum and maximum data points in the data. As an example, if 5% is specified, then the minimum 5% and maximum 5% of data points will be ignored when colouring the map.
There are two valid data formats that the visual accepts to display custom geometry on the map – WKT and GeoJSON. These geometries need to be properly formatted within your data in order to be displayed on the map.
The visual does not support the ability to upload a file that represents custom geometry (for example: GeoJSON, TopoJSON or Shape files).
The OS visual supports the ability to add custom geometry onto the map.
Your data needs to include a column that consists of WKT geometry to display it on the map using these steps.
It’s quite common that a user might have their geometry in GeoJSON, Shape or another format. These steps will demonstrate how to turn those formats into WKT that the visual will accept.
If your geometry is particularly complex, it may not fully display using this method due to an inherent limitation within Power BI. Results may be improved by reducing the complexity of your geometry using a service such as Map Shaper – https://mapshaper.org
If you need to simplify your geometry, it’s best to do so at the start of this process. Load your geometry into a tool such as QGIS. Then, under Layers, right-click and select Export, then Save Feature as. Save your file as a CSV, then under ‘Geometry’ you want to select AS_ WKT.
Exporting your file as a CSV will create a file with every polygon listed as a separate entry alongside any additional metadata associated with those polygons from the original file. The WKT column in that CSV is what you’d drag into the Features Layer: GeoJSON or WKT Geometry in the OS Visual to display the geometry.
There’s a Power BI limitation where each ‘cell’ in a table of data has a maximum size of 32 KB. This means if any of your polygons is larger than 32 KB then they will not display properly and the geometry will need to be simplified.
If you want to join points and polygons on the same map, then this CSV (the polygons) will either need to be joined to your other data (the points) under the Power BI data model or merged into the same table of data.
This step may be easier to follow by navigating to the ‘Add Some Data Tab’ on the landing page then looking for the ‘GeoJSON’ section. The landing page can be accessed via the ‘Question Mark’ button in the bottom left.
There are two ways you can use GeoJSON in this visual:
You can visualise features using a JSON formatted geometry column within a table - this can be just the geometry, for example:
{"type": "Polygon", "coordinates": [...]}
or may be a Feature, for example:
{"type": "Feature", "properties": {...}, "geometry": ...}
If the Feature has properties, these will be added to map popups by default, but will be replaced if a column is dragged into the Features Layer: Pop-ups field.
There’s a 32 KB limitation on the size of the field, meaning complicated geometries will be truncated. You may need to simplify your geometries to get them to display.
This option requires some extra steps:
This should open your data in query view and your features will be automatically expanded, giving you columns like 'features.geometry.type'.
Performing this action may have expanded your GeoJSON more than necessary, so in the Query Settings panel (probably on the right side of the window), click the cross next to 'Expanded features.geometry.coordinates' in Applied Steps to remove the step that expands your coordinates.
In the toolbar at the top go to ‘Add Column’ Custom Column. In the dialog box, add a name such as 'geom' and enter the following formula:
{" & """type""" & ":" & """" & [features.geometry.type] & """" & "," & """coordinates""" & ":" & Text.FromBinary(Json.FromValue([features.geometry.coordinates])) & "
Click OK, go back to the Home tab and Close & Apply, then drag your new 'geom' column into the Features Layer: GeoJSON or WKT Geometries field in Build visual.