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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DR1
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
MarcelBeug
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
MarcelBeug
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)

@MarcelBeug 

 

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

 

Thanks!

Anonymous
Not applicable

Saved my day!

Thank you @MarcelBeug

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors
Users online (6,470)