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! Learn more

Reply
Poisedon
Frequent Visitor

Importing data from multiple XML files

Hi all,

I'm trying to import data from all xml files in a folder. You know how to edit this code in the Query for take all xml files?

= #"Modificato tipo"{[#"Folder Path"="C:\Users\johnbyer\Desktop\Fatturazione attiva\",Name="10.xml"]}[Content]

 

I need to replace Name="10.xml" with a code or a function that make possible to take all xml files and not only 1. I'm a newbie please easy steps. I tried this https://community.powerbi.com/t5/Desktop/Import-multiple-XML-files/m-p/8900#M1596 but i dont know how to add a column and seems not working

 

I tried with "C:\Users\johnbyer\Desktop\Fatturazione attiva\*.xml" but not working

1 ACCEPTED SOLUTION

Hi @Poisedon,

 

Since you are using the Folder connector, you just need to follow the guidance of the connector GUI. Please refer to the snapshot below. Why did you need to replace the code?

Importing-data-from-multiple-XML-files

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

You want to start with a Folder query. Once you enter your path, on the next screen choose Combine and Edit.

 

Should end up with something like this:

 

let
    Source = Folder.Files("c:\temp\powerbi\xml"),
    #"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
    #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File from xml", each #"Transform File from xml"([Content])),
    #"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
    #"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File from xml"}),
    #"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File from xml", Table.ColumnNames(#"Transform File from xml"(#"Sample File"))),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"thing", type text}, {"value", Int64.Type}})
in
    #"Changed Type"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Can you explain easier? I tried copying this code and editing path but still not working

Hi @Poisedon,

 

Since you are using the Folder connector, you just need to follow the guidance of the connector GUI. Please refer to the snapshot below. Why did you need to replace the code?

Importing-data-from-multiple-XML-files

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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