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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
cboake
Frequent Visitor

Help with this JSON

Hi all,

 

I'm hoping to expand some json into a table but because of the way the json is structured, the values I need end up as column headers instead of row values. Has anyone run into this before?

 

Example of json input:

2019-12-30_15h45_48.png

 

What happens in PowerBI:

1.png

2.png

 

Desired end state of query should result in a table like this:

nirvana.png

 

Additionally, if I expand the "50" column then the "50" is wiped out by the next record "101" which is in turn wiped out by "140" etc down the line. Renaming the expanded column doesn't help. Power Query:

let
Source = Json.Document(Web.Contents("APIurl")),
data = Source[data],
attendance = data[attendance],
#"Converted to Table" = Record.ToTable(attendance),
#"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"50"}, {"50"}),
#"Expanded 50" = Table.ExpandRecordColumn(#"Expanded Value", "50", {"101"}, {"101"}),
#"Expanded 101" = Table.ExpandRecordColumn(#"Expanded 50", "101", {"140"}, {"140"})
in
#"Expanded 101"

 

Does anyone know a way to achieve this? Is this just bad json?

 

Thank you,
UIT

2 REPLIES 2
Jimmy801
Community Champion
Community Champion

Hello @cboake

were you able to solve the problem with any reply given?

If so, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

All the best

Jimmy

Jimmy801
Community Champion
Community Champion

Hello

To me it seems that this json has all nested objects with the real data only after 4th level. Don't know what this ids are doing there.
You could try this function to extract all data https://www.thebiccountant.com/2018/06/17/automatically-expand-all-fields-from-a-json-document-in-po...

Hope this helps

Jimmy

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.