Using Stat-Xplore API in Power BI

A common use case for the Stat-Xplore API feature is creating Power BI dashboards with a live connection to the Stat-Xplore data. This means that these users have access to custom visualisations that stay up to date.

These pages are to support other interested users to take advantage of this feature.

Overview

Requirements

Stat-Xplore API Key

For help getting your Stat-Xplore API Key look under the API Keys header guidance here: API Keys

Retrieving Open Data .json text

You will need the json text file with the schema of the data that you would like to connect to Power BI.

    Image of table built.



    Image of drop-down list.



    Image of replace all box.



DAX Query Template

The query template below is what you will use in Power Query to source the data (Refer to next section for more step-by-step guidance for this bit). You will need to replace the highlighted sections. The formatting of text in Power Query will not matter.

let

url = "https://stat-xplore.dwp.gov.uk/webapi/rest/v1/table",

body = "",

header = [#"Content-Type" = application/json",

#"APIKey"=""],

response = Web.Contents(url,[Content=Text.ToBinary(body),Headers=header]),

Source = Json.Document(response,1252)

in

Source