Connecting to the NOMIS API in PowerBI

Office for National Statistics
Office for National StatisticsOffice for National Statistics

This guide was prepared by Suffolk County Council to support others in constructing their dashboards, using the NOMIS API through PowerBI.

Public Health & Communities Analytics | Suffolk County Council | Version 1.2 (September 2023)
phc_analytics@suffolk.gov.uk
Connecting to the NOMIS API in Power BI
Introduction
Using the NOMIS API allows data to be updated automatically when the dataset is refreshed
in the Power BI Service or Power BI Desktop. The method described in this guide was initially
created with assistance from colleagues at Norfolk County Council.
Using the NOMIS website to get queries
Queries are compiled using the NOMIS website. This allows you to select variables of
interest and set parameters for data to download. Once you have made your selections,
choose the NOMIS API data format.
Click Download Data. From this screen, right-click on Link (data.csv) and copy this link.
Public Health & Communities Analytics | Suffolk County Council | Version 1.2 (September 2023)
phc_analytics@suffolk.gov.uk
This link will be used as a query in Power BI Desktop to connect to the API. No API key is
required.
Using NOMIS queries in Power BI
In Power BI desktop, click ‘Get data’ then select the ‘Web’ source. Paste the copied URL (this
is known as the Query to the API) from the NOMIS website and click OK. Click Transform
data from the Preview window.
Once the query has been added, you may wish to use the formula bar or advanced editor to
remove the date parameter. This means your query will return data for all available dates.
To use Advanced Editor, click on the Home tab, then Advanced Editor.
Remove the part of the query that contains the word date. Delete everything from the start
of the word ‘date’ to the following ampersand (&). For example, in the query below, the text
highlighted in red would be deleted.
https://www.nomisweb.co.uk/api/v01/dataset/NM_17_5.data.csv?geography=1853882369
...1853882372,1853882374...1853882379&date=latest&variable=18,45,248,249,84,83,111,1
Public Health & Communities Analytics | Suffolk County Council | Version 1.2 (September 2023)
phc_analytics@suffolk.gov.uk
487,1488,27,54,250,251,93,92,120,1489,1490,36,63,252,253,102,101,129,1491,1492,1532..
.1540,594,820,841,290,720...722,335,344&measures=20599,21001,21002,21003
If asked which credentials to use for this data source, select Anonymous credentials and
Public privacy level.
Transforming data for use in the report
To use the data to build reports in Power BI Desktop, transformations will need to be
applied. From the Transform tab, select Use first row as headers. Now that each column is
correctly labelled, only keep the columns that are required. This is good practice as it
reduces the size of the dataset. From the Home tab, click Choose Columns. The columns
that will usually be required are:
• DATE
• DATE_NAME
• GEOGRAPHY_NAME
• GEOGRAPHY_CODE
• GEOGRAPHY_TYPE
• VARIABLE_NAME
• VARIABLE_SORTORDER
• MEASURES_NAME
• OBS_VALUE
Next, pivot the MEASURES_NAME column to obtain a separate column for each measure.
That is, a column for the numerator, denominator and percentage (where applicable). Click
the MEASURES_NAME column, then click Pivot Column from the Transform tab. The values
column is OBS_VALUE. Under the Advanced options, select Don’t Aggregate for the
Aggregate Value Function.
Public Health & Communities Analytics | Suffolk County Council | Version 1.2 (September 2023)
phc_analytics@suffolk.gov.uk
The MEASURES_NAME and OBS_VALUE columns of the table should have been replaced by
columns in the format below:
Further recommended transformations on this data (not detailed here) are:
• Renaming columns as appropriate.
• Changing data types for each column as appropriate.
• Dividing values in the Variable column by 100 to get data as a percentage.
Refreshing data
Queries to the NOMIS API will return the latest available data whenever they are refreshed.
This can include scheduled dataset refreshes in the Power BI service. When NOMIS are
updating the data in the API, the query will fail and any Power BI dataset including a query
to the NOMIS API refreshed during this period will fail. This is usually a temporary issue that
will be automatically resolved once NOMIS have finished updating the data in the API.
More information
https://www.nomisweb.co.uk/api/v01/help

Recomendados

Tableau Prep.pptxTableau Prep.pptx
Tableau Prep.pptxVenneladonthireddy1
122 visualizações31 slides
charecteristics of sound physicscharecteristics of sound physics
charecteristics of sound physicsSaminaTariq5
863 visualizações23 slides
Unit08 dbmsUnit08 dbms
Unit08 dbmsarnold 7490
3.4K visualizações45 slides
Pivot tablePivot table
Pivot tableVijay Perepa
18.8K visualizações11 slides
Cell referencesCell references
Cell referencesIlgar Zarbaliyev
1.4K visualizações2 slides

Mais conteúdo relacionado

Similar a Connecting to the NOMIS API in PowerBI

SSRS 2008 R2SSRS 2008 R2
SSRS 2008 R2tomerl
2.5K visualizações26 slides
Informatica PowerAnalyzer 4.0 1 of 3Informatica PowerAnalyzer 4.0 1 of 3
Informatica PowerAnalyzer 4.0 1 of 3ganblues
2K visualizações59 slides

Similar a Connecting to the NOMIS API in PowerBI(20)

Connecting to the StatXplore API in PowerBIConnecting to the StatXplore API in PowerBI
Connecting to the StatXplore API in PowerBI
Office for National Statistics96 visualizações
Developing a ssrs report using a ssas data sourceDeveloping a ssrs report using a ssas data source
Developing a ssrs report using a ssas data source
relekarsushant3.6K visualizações
William Schaffrans Bus Intelligence PortfolioWilliam Schaffrans Bus Intelligence Portfolio
William Schaffrans Bus Intelligence Portfolio
wschaffr241 visualizações
SSRS 2008 R2SSRS 2008 R2
SSRS 2008 R2
tomerl2.5K visualizações
Informatica PowerAnalyzer 4.0 1 of 3Informatica PowerAnalyzer 4.0 1 of 3
Informatica PowerAnalyzer 4.0 1 of 3
ganblues2K visualizações
Oracle-Whitepaper-Optimizer-with-Oracle-Database-12c.pdfOracle-Whitepaper-Optimizer-with-Oracle-Database-12c.pdf
Oracle-Whitepaper-Optimizer-with-Oracle-Database-12c.pdf
DetchDuvanGaelaCamar2 visualizações
MS Bi Portfolio Gregory LeeMS Bi Portfolio Gregory Lee
MS Bi Portfolio Gregory Lee
keeperx99355 visualizações
Ssis Ssas Ssrs Sp Pps Hong Bing LiSsis Ssas Ssrs Sp Pps Hong Bing Li
Ssis Ssas Ssrs Sp Pps Hong Bing Li
Hong-Bing Li949 visualizações
ETL Microsoft MaterialETL Microsoft Material
ETL Microsoft Material
Ahmed Hashem86 visualizações
Office excel tips and tricks 201101Office excel tips and tricks 201101
Office excel tips and tricks 201101
Vishwanath Ramdas1.4K visualizações
SSIS_SSRS_PPS_SP_SSAS_Hong_Bing LiSSIS_SSRS_PPS_SP_SSAS_Hong_Bing Li
SSIS_SSRS_PPS_SP_SSAS_Hong_Bing Li
Hong-Bing Li274 visualizações
C:\fakepath\ssis ssas sssrs_pps_hong_bingli_v2003C:\fakepath\ssis ssas sssrs_pps_hong_bingli_v2003
C:\fakepath\ssis ssas sssrs_pps_hong_bingli_v2003
Hong-Bing Li271 visualizações
Kevin Fahy   Bi PortfolioKevin Fahy   Bi Portfolio
Kevin Fahy Bi Portfolio
KevinPFahy488 visualizações
Tony Von Gusmann & MS BITony Von Gusmann & MS BI
Tony Von Gusmann & MS BI
vongusmann691 visualizações
Cognos framework managerCognos framework manager
Cognos framework manager
maxonlinetr619 visualizações
6 bosch rexroth_eng_016 bosch rexroth_eng_01
6 bosch rexroth_eng_01
vanclea2004240 visualizações
SSIS_SSAS_SSRS_SP_PPS_HongBingLiSSIS_SSAS_SSRS_SP_PPS_HongBingLi
SSIS_SSAS_SSRS_SP_PPS_HongBingLi
Hong-Bing Li412 visualizações
10400_SGF_DDPO_Final_03_21_201610400_SGF_DDPO_Final_03_21_2016
10400_SGF_DDPO_Final_03_21_2016
Sachin Verma93 visualizações

Mais de Office for National Statistics(20)

SlideShare ONS Economic Forum Slidepack - 13 November 2023SlideShare ONS Economic Forum Slidepack - 13 November 2023
SlideShare ONS Economic Forum Slidepack - 13 November 2023
Office for National Statistics62 visualizações
SlideShare ONS Economic Forum Slidepack - 16 October 2023SlideShare ONS Economic Forum Slidepack - 16 October 2023
SlideShare ONS Economic Forum Slidepack - 16 October 2023
Office for National Statistics7 visualizações
So what does ‘Beyond GDP’ mean for the UK – 12 October 2023So what does ‘Beyond GDP’ mean for the UK – 12 October 2023
So what does ‘Beyond GDP’ mean for the UK – 12 October 2023
Office for National Statistics158 visualizações
SlideShare Measuring the Economy Slidepack - 29 September 2023SlideShare Measuring the Economy Slidepack - 29 September 2023
SlideShare Measuring the Economy Slidepack - 29 September 2023
Office for National Statistics91 visualizações
Why dashboards?Why dashboards?
Why dashboards?
Office for National Statistics7 visualizações
SlideShare ONS Economic Forum Slidepack - 18 September 2023SlideShare ONS Economic Forum Slidepack - 18 September 2023
SlideShare ONS Economic Forum Slidepack - 18 September 2023
Office for National Statistics256 visualizações
ONS Local presents Suffolk County Council's Cost of Living DashboardONS Local presents Suffolk County Council's Cost of Living Dashboard
ONS Local presents Suffolk County Council's Cost of Living Dashboard
Office for National Statistics168 visualizações
ONS Local and Data Science Community Workshop 1: How to use APIsONS Local and Data Science Community Workshop 1: How to use APIs
ONS Local and Data Science Community Workshop 1: How to use APIs
Office for National Statistics153 visualizações
ONS Local and Data Science Community Workshop 1: How to use APIsONS Local and Data Science Community Workshop 1: How to use APIs
ONS Local and Data Science Community Workshop 1: How to use APIs
Office for National Statistics119 visualizações
ONS Local and Data Science Community Workshop 1: How to use APIsONS Local and Data Science Community Workshop 1: How to use APIs
ONS Local and Data Science Community Workshop 1: How to use APIs
Office for National Statistics91 visualizações
ONS Local presents: Adult Education Outcomes in LondonONS Local presents: Adult Education Outcomes in London
ONS Local presents: Adult Education Outcomes in London
Office for National Statistics43 visualizações
ONS Local presents: Explore Subnational StatisticsONS Local presents: Explore Subnational Statistics
ONS Local presents: Explore Subnational Statistics
Office for National Statistics71 visualizações
ONS Local presents - Census 2021 Education AnalysisONS Local presents - Census 2021 Education Analysis
ONS Local presents - Census 2021 Education Analysis
Office for National Statistics62 visualizações
SlideShare ONS Economic Forum Slidepack - 12 June 2023SlideShare ONS Economic Forum Slidepack - 12 June 2023
SlideShare ONS Economic Forum Slidepack - 12 June 2023
Office for National Statistics216 visualizações
ONS local presents clusteringONS local presents clustering
ONS local presents clustering
Office for National Statistics173 visualizações
ONS Local presents: Census 2021, products and analysisONS Local presents: Census 2021, products and analysis
ONS Local presents: Census 2021, products and analysis
Office for National Statistics71 visualizações
SlideShare ONS Economic Forum Slidepack - 15 May 2023.pptxSlideShare ONS Economic Forum Slidepack - 15 May 2023.pptx
SlideShare ONS Economic Forum Slidepack - 15 May 2023.pptx
Office for National Statistics194 visualizações
SlideShare Annual crime and justice statistics forum 2023.pptxSlideShare Annual crime and justice statistics forum 2023.pptx
SlideShare Annual crime and justice statistics forum 2023.pptx
Office for National Statistics42 visualizações
ONS business data and statistics user eventONS business data and statistics user event
ONS business data and statistics user event
Office for National Statistics167 visualizações

Último(20)

Sponsor for Child Bright FutureSponsor for Child Bright Future
Sponsor for Child Bright Future
SERUDS INDIA10 visualizações
 Approaches to Estimating the Noncyclical Rate of Unemployment Approaches to Estimating the Noncyclical Rate of Unemployment
Approaches to Estimating the Noncyclical Rate of Unemployment
Congressional Budget Office338 visualizações
UNEP Emission Gap Report 2023UNEP Emission Gap Report 2023
UNEP Emission Gap Report 2023
Energy for One World24 visualizações
ecb.sp231121_1~8df317dc17.en.pdfecb.sp231121_1~8df317dc17.en.pdf
ecb.sp231121_1~8df317dc17.en.pdf
Société Tripalio386 visualizações
Dr Getaw Tadesse - 2023 ReSAKSS Conference .pptxDr Getaw Tadesse - 2023 ReSAKSS Conference .pptx
Dr Getaw Tadesse - 2023 ReSAKSS Conference .pptx
AKADEMIYA20637 visualizações
2023 Veterans Day Exhibit.pptx2023 Veterans Day Exhibit.pptx
2023 Veterans Day Exhibit.pptx
lday446 visualizações
Permit Coordinator - PT Job Bulletin.pdfPermit Coordinator - PT Job Bulletin.pdf
Permit Coordinator - PT Job Bulletin.pdf
NorthwestBOCA55 visualizações
UNiTE- Invest to Prevent Violence against Women & Girls!UNiTE- Invest to Prevent Violence against Women & Girls!
UNiTE- Invest to Prevent Violence against Women & Girls!
Christina Parmionova6 visualizações
2023-11-17-building_inspector_posting (1).pdf2023-11-17-building_inspector_posting (1).pdf
2023-11-17-building_inspector_posting (1).pdf
NorthwestBOCA13 visualizações
ST-15631-2023-INIT_en.pdfST-15631-2023-INIT_en.pdf
ST-15631-2023-INIT_en.pdf
Société Tripalio2K visualizações
multi media slides.pptxmulti media slides.pptx
multi media slides.pptx
ShaqSantibaezAndes16 visualizações
NGO awareness programsNGO awareness programs
NGO awareness programs
SERUDS INDIA7 visualizações
Ms. Julie Collins - 2023 ReSAKSS Conference.pptxMs. Julie Collins - 2023 ReSAKSS Conference.pptx
Ms. Julie Collins - 2023 ReSAKSS Conference.pptx
AKADEMIYA20637 visualizações
Autumn (Statement) WatchAutumn (Statement) Watch
Autumn (Statement) Watch
ResolutionFoundation206 visualizações
penny appeal usa.pdfpenny appeal usa.pdf
penny appeal usa.pdf
pennyappealusaseo10 visualizações

Connecting to the NOMIS API in PowerBI

  • 1. Public Health & Communities Analytics | Suffolk County Council | Version 1.2 (September 2023) phc_analytics@suffolk.gov.uk Connecting to the NOMIS API in Power BI Introduction Using the NOMIS API allows data to be updated automatically when the dataset is refreshed in the Power BI Service or Power BI Desktop. The method described in this guide was initially created with assistance from colleagues at Norfolk County Council. Using the NOMIS website to get queries Queries are compiled using the NOMIS website. This allows you to select variables of interest and set parameters for data to download. Once you have made your selections, choose the NOMIS API data format. Click Download Data. From this screen, right-click on Link (data.csv) and copy this link.
  • 2. Public Health & Communities Analytics | Suffolk County Council | Version 1.2 (September 2023) phc_analytics@suffolk.gov.uk This link will be used as a query in Power BI Desktop to connect to the API. No API key is required. Using NOMIS queries in Power BI In Power BI desktop, click ‘Get data’ then select the ‘Web’ source. Paste the copied URL (this is known as the Query to the API) from the NOMIS website and click OK. Click Transform data from the Preview window. Once the query has been added, you may wish to use the formula bar or advanced editor to remove the date parameter. This means your query will return data for all available dates. To use Advanced Editor, click on the Home tab, then Advanced Editor. Remove the part of the query that contains the word date. Delete everything from the start of the word ‘date’ to the following ampersand (&). For example, in the query below, the text highlighted in red would be deleted. https://www.nomisweb.co.uk/api/v01/dataset/NM_17_5.data.csv?geography=1853882369 ...1853882372,1853882374...1853882379&date=latest&variable=18,45,248,249,84,83,111,1
  • 3. Public Health & Communities Analytics | Suffolk County Council | Version 1.2 (September 2023) phc_analytics@suffolk.gov.uk 487,1488,27,54,250,251,93,92,120,1489,1490,36,63,252,253,102,101,129,1491,1492,1532.. .1540,594,820,841,290,720...722,335,344&measures=20599,21001,21002,21003 If asked which credentials to use for this data source, select Anonymous credentials and Public privacy level. Transforming data for use in the report To use the data to build reports in Power BI Desktop, transformations will need to be applied. From the Transform tab, select Use first row as headers. Now that each column is correctly labelled, only keep the columns that are required. This is good practice as it reduces the size of the dataset. From the Home tab, click Choose Columns. The columns that will usually be required are: • DATE • DATE_NAME • GEOGRAPHY_NAME • GEOGRAPHY_CODE • GEOGRAPHY_TYPE • VARIABLE_NAME • VARIABLE_SORTORDER • MEASURES_NAME • OBS_VALUE Next, pivot the MEASURES_NAME column to obtain a separate column for each measure. That is, a column for the numerator, denominator and percentage (where applicable). Click the MEASURES_NAME column, then click Pivot Column from the Transform tab. The values column is OBS_VALUE. Under the Advanced options, select Don’t Aggregate for the Aggregate Value Function.
  • 4. Public Health & Communities Analytics | Suffolk County Council | Version 1.2 (September 2023) phc_analytics@suffolk.gov.uk The MEASURES_NAME and OBS_VALUE columns of the table should have been replaced by columns in the format below: Further recommended transformations on this data (not detailed here) are: • Renaming columns as appropriate. • Changing data types for each column as appropriate. • Dividing values in the Variable column by 100 to get data as a percentage. Refreshing data Queries to the NOMIS API will return the latest available data whenever they are refreshed. This can include scheduled dataset refreshes in the Power BI service. When NOMIS are updating the data in the API, the query will fail and any Power BI dataset including a query to the NOMIS API refreshed during this period will fail. This is usually a temporary issue that will be automatically resolved once NOMIS have finished updating the data in the API. More information https://www.nomisweb.co.uk/api/v01/help