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

Extract related Values from two Arrays columns

Hi all 

I have this excel file (as an example) 

Nazdac911_0-1678878777172.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-1678878839780.png

How could I implemnt that ! 
thanks in advance 
Regards 

2 REPLIES 2
rohit_singh
Solution Sage
Solution Sage

Hi @Nazdac911 ,

In Power Query, please open a blank query --> Advanced editor -->Remove any existing code and copy and paste the below code.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("FYqxDYAwDMBesTIzJIXQ9gIkXoiyMZP/N8pgWbIcIXe9sslV9SyFYjR2DpyTzsi/dqU7QxnOVKZjuk61RUvJ/AA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"First Name" = _t, #"Last Name" = _t, #"Age (Year)" = _t, #"Length (CM)" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"First Name", type text}, {"Last Name", type text}, {"Age (Year)", type text}, {"Length (CM)", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","[","",Replacer.ReplaceText,{"Age (Year)", "Length (CM)"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","]","",Replacer.ReplaceText,{"Age (Year)", "Length (CM)"}),
    #"Added Custom" = Table.AddColumn(#"Replaced Value1", "Custom", each Table.FromColumns({Text.Split([#"Age (Year)"], " "), Text.Split([#"Length (CM)"], " ")})),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Age (Year)", "Length (CM)"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column1", "Column2"}, {"Age (Year)", "Length (CM)"})
in
    #"Expanded Custom"

 

Input

rohit_singh_0-1678891707972.png


Output

rohit_singh_1-1678891724910.png

 

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂



Thanks a lot 
Could you mention the steps in power Query to genetrate this code .. 
What I added is an example table , the real one in 15 columns with different data types 🙂 
thanks a again 

Regards 

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.