Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
274188A
Advocate I
Advocate I

Shaping / Transforming JSON Data

I have a public API that's freely availabe to use by anyone (no auth required).  The Request URL I have is:

https://myhospitalsapi.aihw.gov.au/api/v1/measure-downloads/measure-download-codes

This returns JSON (see JSON Result below for full result).

I'm having trouble Transforming this to a Table of data.

 

My hope is to have a single table that has 3 columns:- 'datasheet_code', 'datasheet_description', 'datasheet_type'.

I'm not sure how to cater for the result json format that has an extra layer sitting above these fields e.g.

 

  "myh-adm": [
      {
        "datasheet_code""myh-adm",
        "datasheet_description""A datasheet covering the number of admisions to hospitals.",
        "datasheet_type""MEASURE-DATA"
      }
    ],

 


JSON Result

{
  "result": {
    "myh-adm": [
      {
        "datasheet_code""myh-adm",
        "datasheet_description""A datasheet covering the number of admisions to hospitals.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-los": [
      {
        "datasheet_code""myh-los",
        "datasheet_description""A datasheet covering the average length of stay of overnight hospital stays and bed days.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-cancer": [
      {
        "datasheet_code""myh-cancer",
        "datasheet_description""A datasheet covering cancer surgery waiting times.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-cws": [
      {
        "datasheet_code""myh-cws",
        "datasheet_description""A datasheet covering financial performance of hospitals based on Cost per NWAU.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-ed": [
      {
        "datasheet_code""myh-ed",
        "datasheet_description""A datasheet covering emergency department waiting times and the time in emergency departments.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-es": [
      {
        "datasheet_code""myh-es",
        "datasheet_description""A datasheet covering elective surgery waiting times.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-hh": [
      {
        "datasheet_code""myh-hh",
        "datasheet_description""A datasheet covering hand hygiene rates for public hospitals.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-hh-private": [
      {
        "datasheet_code""myh-hh-private",
        "datasheet_description""A datasheet covering hand hygiene rates for private hospitals.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-sab": [
      {
        "datasheet_code""myh-sab",
        "datasheet_description""A datasheet covering rates and numbers of healthcare-associated Staphylococcus aureus bloodstream infections for public hospitals.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-sab-private": [
      {
        "datasheet_code""myh-sab-private",
        "datasheet_description""A datasheet covering rates and numbers of healthcare-associated Staphylococcus aureus bloodstream infections for private hospitals.",
        "datasheet_type""MEASURE-DATA"
      }
    ],
    "myh-ssi": [
      {
        "datasheet_code""myh-ssi",
        "datasheet_description""A datasheet covering the available services of reporting units.",
        "datasheet_type""MEASURE-DATA"
      }
    ]
  },
  "version_information": {
    "api_version""1.6.0.0",
    "data_version"2023101101,
    "date_uploaded""2023-10-11T00:00:00",
    "requested_time_stamp""2023-10-25T13:46:50.7503006+11:00"
  }
}
1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

let
    Source = Web.Contents("https://myhospitalsapi.aihw.gov.au/api/v1/measure-downloads/measure-download-codes"),
    Custom1 = Table.FromRecords(List.Combine(Record.ToList(Json.Document(Source)[result])))
in
    Custom1

wdx223_Daniel_0-1698206055640.png

 

View solution in original post

2 REPLIES 2
274188A
Advocate I
Advocate I

Life Saver - thanks so much

wdx223_Daniel
Super User
Super User

let
    Source = Web.Contents("https://myhospitalsapi.aihw.gov.au/api/v1/measure-downloads/measure-download-codes"),
    Custom1 = Table.FromRecords(List.Combine(Record.ToList(Json.Document(Source)[result])))
in
    Custom1

wdx223_Daniel_0-1698206055640.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.