cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

XML Query Column which contains both "Table" and "Records"

The Column "SINGLE_ROOM_AREA" contains "Table" and values. But the tables only contain one value. How do I get this values expanded?

xml_powerquery2.PNGxml_powerquery.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

You can transform the column like in the second step of this query:

 

let
    Source = #table({"SINGLE_ROOM_AREA"},{{"150"},{#table(type table[#"Element:text" = text],{{"51"}})}}),
    Transformed = Table.TransformColumns(Source, {{"SINGLE_ROOM_AREA", each if _ is table then Table.FirstValue(_) else _}})
in
    Transformed
Specializing in Power Query Formula Language (M)

View solution in original post

4 REPLIES 4
Highlighted
Community Champion
Community Champion

You can transform the column like in the second step of this query:

 

let
    Source = #table({"SINGLE_ROOM_AREA"},{{"150"},{#table(type table[#"Element:text" = text],{{"51"}})}}),
    Transformed = Table.TransformColumns(Source, {{"SINGLE_ROOM_AREA", each if _ is table then Table.FirstValue(_) else _}})
in
    Transformed
Specializing in Power Query Formula Language (M)

View solution in original post

Highlighted

Thank you @MarcelBeug

Highlighted
Anonymous
Not applicable

Saved my day!

Highlighted

@MarcelBeug 

 

What if I need to get all the data not just the first one?

 

Thanks!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors