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
Nazdac911
Helper II
Helper II

In Power Query , how to Extract values from many Arrays columns

Hi all 

I have this excel file (as an example) ( the original data is much bigger and had 15 columns 

Nazdac911_0-1678953170326.png

Arrays values in Age and Length columns are related .. 
I want inside power Query to extract these values and get the follwoing table : 

Nazdac911_1-1678953217021.png

Wht are the steps in power Query to  implemnt that ! 
I looked up Youtube , and mostly the JSON columns are not formatted as a numaric array ! 
thanks in advance 
Regards 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Nazdac911 , convert them to list by replace [ -> { and ] -> }  and space with comma

 

then use List.Zip to zip the columns into a new column

 

Find the code below

Please check steps after custom column, attaching the file used

 

 

let
    Source = Excel.Workbook(File.Contents("C:\Amit Files\PBI two list.xlsx"), null, true),
    Data_Sheet = Source{[Item="Data",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Data_Sheet, [PromoteAllScalars=true]),
    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Zip", each let

_break = List.Zip( {Text.Split([Subject],","), Text.Split([Marks],",")} ),
_Trans = List.Transform(_break, each Record.FromList(_, {"Subject", "Marks"}))
in 
_Trans),
    #"Expanded Zip" = Table.ExpandListColumn(#"Added Custom", "Zip"),
    #"Expanded Zip1" = Table.ExpandRecordColumn(#"Expanded Zip", "Zip", {"Subject", "Marks"}, {"Zip.Subject", "Zip.Marks"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Zip1",{"Subject", "Marks"})
in
    #"Removed Columns"

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Nazdac911
Helper II
Helper II

Thanka  alot for this solution 
I will accept this as a solution 
I tried it for my data and it did not work , but I think this is because of data corrupted , I keep reciving "Expression.Error: We cannot convert the value null to type Text" 😞 


amitchandak
Super User
Super User

@Nazdac911 , convert them to list by replace [ -> { and ] -> }  and space with comma

 

then use List.Zip to zip the columns into a new column

 

Find the code below

Please check steps after custom column, attaching the file used

 

 

let
    Source = Excel.Workbook(File.Contents("C:\Amit Files\PBI two list.xlsx"), null, true),
    Data_Sheet = Source{[Item="Data",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Data_Sheet, [PromoteAllScalars=true]),
    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Zip", each let

_break = List.Zip( {Text.Split([Subject],","), Text.Split([Marks],",")} ),
_Trans = List.Transform(_break, each Record.FromList(_, {"Subject", "Marks"}))
in 
_Trans),
    #"Expanded Zip" = Table.ExpandListColumn(#"Added Custom", "Zip"),
    #"Expanded Zip1" = Table.ExpandRecordColumn(#"Expanded Zip", "Zip", {"Subject", "Marks"}, {"Zip.Subject", "Zip.Marks"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Zip1",{"Subject", "Marks"})
in
    #"Removed Columns"

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.