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
Anonymous
Not applicable

Convert XML ragged hierarchies to PBI Dataset

HI All,

 

I am loading XML data into PBI.  Each row has a different level of hierarchy.  When Power Query has "split" one level, it can't split the next level, because some data is now granular ( eg text) and some is still packed eg shows as [Table].

 

1. Is there are way to filter in the [Table] data so I can split it again?

OR 

2. Is there a hierarchical way the "split" command can recurse until it runs out of packed data?

OR

3. Any other way to deal with mixed-level hierarchies in Power Query?

 

Thanks

 

Geoff Speedy 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks Vanessa,

 

I solved it by creating 2 queries,  then combining them after splitting the second query twice.

 

I noticed that the offending rows (still showing [Table] after the first split) throw an error when you run text functions on them. So I forced an error with a text function,

= Table.AddColumn(#"Added Custom", "Body1", each try Text.Replace([Note Body],",","") otherwise null)

and saved the 2 sets of rows into separate tables

= Table.SelectRows(#"Added Custom1", each ([Body1] = null))

= Table.SelectRows(#"Added Custom1", each ([Body1] <> null))

 

At this point in the offending rows dataset, Power Query recognised the column can be split, so I split it again. 

 

Then I combined the new dataset with the old dataset.

 

Cheers

 

Geoff Speedy

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks Vanessa,

 

I solved it by creating 2 queries,  then combining them after splitting the second query twice.

 

I noticed that the offending rows (still showing [Table] after the first split) throw an error when you run text functions on them. So I forced an error with a text function,

= Table.AddColumn(#"Added Custom", "Body1", each try Text.Replace([Note Body],",","") otherwise null)

and saved the 2 sets of rows into separate tables

= Table.SelectRows(#"Added Custom1", each ([Body1] = null))

= Table.SelectRows(#"Added Custom1", each ([Body1] <> null))

 

At this point in the offending rows dataset, Power Query recognised the column can be split, so I split it again. 

 

Then I combined the new dataset with the old dataset.

 

Cheers

 

Geoff Speedy

vanessafvg
Super User
Super User

its much easier to interpet what you asking for when you provide sample data and what you expect to happen with that data.  Please provide more details, its very hard to respond to a conceptual post like this, sample data with your expected requirement is necessary. 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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