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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AshleyWells
Regular Visitor

JSON data stored in 2 lists. 1 columns header, 1 data. Need to make into a table

Hi all,

 

I was wondering if anyone has any experience in converting multiple rows of JSON data that is stored as 2 lists, 1 as column headers and the other as the data and transforming them into 1 table?

I have some experience with Power Query but really struggling with this.

 

When I parse the JSON data, I get this.

 

AshleyWells_0-1681206307618.png

 

When I expand the record, I get this.

This gives me the column names and the data.

 

AshleyWells_1-1681206370878.png

 

I'm struggling to transform this data for all rows into a table.

 

Can anyone help?

 

Thanks in advance 🙂

 

1 ACCEPTED SOLUTION

Hi @AshleyWells 

 

Please add a custom column with this. Notice that there is a pair of {} around [ColumnData]. 

= Table.AddColumn(PreviousStep, "Custom", each #table([ColumnNames],{[ColumnData]}))

vjingzhang_0-1681352330330.png

Then expand the custom table column. 

vjingzhang_1-1681352466907.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

7 REPLIES 7
ShirinArshadnia
Helper II
Helper II
m_dekorte
Super User
Super User

Hi @AshleyWells ,

 

So does your ColumnData list contain a list for each of the columns in the same order as the ColumnNames?

If so try this

 

 

AddTable = Table.AddColumn( PrevStepName, "t", each 
    Table.FromColumns( [ColumnData], [ColumnNames], MissingField.UseNull )
)

 

 

If instead your ColumnData list contains a list for each row, again in the same order as the ColumnNames.

You can try this.

 

 

AddTable = Table.AddColumn( PrevStepName, "t", each 
    Table.FromRows( [ColumnData], [ColumnNames] )
)

 

 

I hope this is helpful

Hi

 

I've tried using your solutions above and the closest I have got is the 2nd one but it's showing this

AshleyWells_0-1681219219995.png

I've tried to expand the table "t" but it's not showing me any columns

 

Any ideas?

Hi @AshleyWells,

 

Could you share an image of the contents of the [ColumnData]  column as well?

 

I've assumed it contained either a list with nested lists (one for each column header) in that case the list count for [ColumnData] and [ColumnHeaders] should be equal. OR it contained a list with nested lists (one for each row in the table) BUT it could also contain a list with nested records...

 

Can you drill down intoit and let met know what you find?

Thanks!

Hi @m_dekorte 

 

I have to be carefull with this data as it's sensitive

AshleyWells_0-1681223660899.png

Both [ColumnData] and [ColumnNames] should hold the same amount of data in each list.

In the bottom 2 rows of the [ColumnData] there is nested data but I don't need this extracting.

 

Thanks so much for your help so far

 

Ash

Hi @AshleyWells 

 

Please add a custom column with this. Notice that there is a pair of {} around [ColumnData]. 

= Table.AddColumn(PreviousStep, "Custom", each #table([ColumnNames],{[ColumnData]}))

vjingzhang_0-1681352330330.png

Then expand the custom table column. 

vjingzhang_1-1681352466907.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

@v-jingzhang that works perfectly, thanks so much!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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