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
Ymatole
Frequent Visitor

Import data from nested XML into fabric delta tables

 

I have a requirement where i have complex nested XML and i want to explode the same into multiple tables by establishing primary and foreign key relation. How can i achieve the same in fabric. Can we use dataflow gen2 or notebooks would be correct option to do it. Please note nesting can go upto 30+ levels.

1 ACCEPTED SOLUTION

Thank you. It works.

View solution in original post

4 REPLIES 4
v-prasare
Community Support
Community Support

Hi @Ymatole,

We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.

 

 

 

Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support

v-prasare
Community Support
Community Support

Hi @Ymatole,

We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.

 

@Ugk161610, Thanks for your prompt response

 

 

Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support

Ugk161610
Continued Contributor
Continued Contributor

@Ymatole ,

For very deeply nested XML (20–30+ levels) use notebooks (PySpark) in Fabric — not Dataflow Gen2. Dataflow Gen2 is OK for light/medium hierarchies, but for extreme nesting it becomes hard to maintain and fragile. Notebooks give full control, better performance and easier error handling.

 

Why notebooks / Spark:

  • You can use the spark-xml parser to read XML into DataFrames and then programmatically flatten/explode nodes

  • You can handle dynamic/irregular schemas, recursion, and very deep nesting with code (loops or recursion), which a UI pipeline struggles with.
  • Spark scales and writes directly to Delta tables so you can create normalized tables with PK/FK relationships.
  • Easier to add surrogate keys, audit columns, and incremental processing.

Small PySpark example (conceptual):

Ugk161610_0-1765284491288.png

 

GopiKrishna

Thank you. It works.

Helpful resources

Announcements
December Fabric Update Carousel

Fabric Monthly Update - December 2025

Check out the December 2025 Fabric 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.