Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
I need to parse some XML with data stored in element values (rather than attributes) in Power Query. This works fine as long as the elements don't have sub-elements as follows:
<people>
<person id="1" gender="male">
<name>Joe</name>
</person>
<person id="2" gender="female">
<name>Sally</name>
</person>
<person id="3" gender="male">
<name>Mike</name>
</person>
</people>
When my element has sub-elements, Power Query assumes the column is a table datatype and ignores the element values (Joe, Sally, and Mike). It forces me to drill down into the table and provides access to the sub-element's attributes (abbreviated name, full name), which is not what I'm interested in.
<people>
<person id="1" gender="male">
<name>Joe<type value="abbreviated name" />
</name>
</person>
<person id="2" gender="female">
<name>Sally<type value="full name" />
</name>
</person>
<person id="3" gender="male">
<name>Mike<type value="abbreviated name" />
</name>
</person>
</people>I don't need the data in the sub-elements, so any advice on removing them, parsing them, or deleting them would be much appreciated.
Solved! Go to Solution.
Hi @sc20d2 ,
Open your query in Advanced Editor then adjust the Source step to change Xml.Tables to Xml.Document.
You'll still need to do a bit of jiggery-pokery to get the data into the shape you need, but this will at least expose all the data elements for use.
Pete
Proud to be a Datanaut!
Hi @sc20d2 ,
Open your query in Advanced Editor then adjust the Source step to change Xml.Tables to Xml.Document.
You'll still need to do a bit of jiggery-pokery to get the data into the shape you need, but this will at least expose all the data elements for use.
Pete
Proud to be a Datanaut!
Ah, I think I see that now. Thanks very much for the pointer @BA_Pete . That was exactly what I needed!
No problem, happy to help.
Don't forget to give a thumbs-up on any posts that have helped you 👍
Pete
Proud to be a Datanaut!
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |