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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Switching from single xml-file and appended files to importing xml-folder

Hi, 

Currently in Power Query, I import a xml-file for month 1 Region East and append xml-file for month 1 Region West, file for month 2 Region East, month 2 Region West and so on:
Udklip1.JPG


Instead of appending new files each month I want to import the entire folder with xml-files so that my report automtically import new xml-files whenever there are placed in the folder. 

How can I do this without breaking my applied steps? 

 

The beginning of my query looks like this: 
Udklip2.JPG

1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

- Create one query that does exactly what you need

- Create a parameter "FileName" and maintain one complete path as value

- Enter in the advanced editor and change the part of the filename like "C:\.....\example.xlm" with your parameter like Folder.Contentes(FileName)

- rightclick on your query and select "create function". Call it "fnGetData"

- add a new query that reads your folder

- apply a filter that only the files that you need are visilbe

- add a new column and enter the following = fnGetData([Folder Path]&[Name])

- Exapand table

 

If this post helps or solves your problem, please mark it as solution.
Kudos are nice to - thanks
Have fun

Jimmy

View solution in original post

10 REPLIES 10
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

were you able to solve the problem with any reply given?

If so, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

All the best

Jimmy

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please feel free to let me know.
 
Best Regards
Maggie
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

- Create one query that does exactly what you need

- Create a parameter "FileName" and maintain one complete path as value

- Enter in the advanced editor and change the part of the filename like "C:\.....\example.xlm" with your parameter like Folder.Contentes(FileName)

- rightclick on your query and select "create function". Call it "fnGetData"

- add a new query that reads your folder

- apply a filter that only the files that you need are visilbe

- add a new column and enter the following = fnGetData([Folder Path]&[Name])

- Exapand table

 

If this post helps or solves your problem, please mark it as solution.
Kudos are nice to - thanks
Have fun

Jimmy

Anonymous
Not applicable

Hi @Jimmy801 

 

Sorry for my late response due to christmas vacation. 

Some questions regarding your suggestion below; 

- By "one query.. exactly what I need" you mean one query with all of the applied steps including where I also append the other xml files? (picture 1) 

- What does "maintain one complete path as value" means? How should I create the parameter? (picture 2)

pic1
Udklip1.JPG

 

pic2

Udklip2.JPG


 

Hello @Anonymous ,

 

no problem..

about your 2 questions:

no, create one query that processes only ONE xml file as you need it, without including any appending

create a parameter with the complete file path for ONE xml file, like that

grafik.png

 

the other steps as already stated in my solution

 

Hope this helps

 

Jimmy

Anonymous
Not applicable

Hi @Jimmy801 

Im obviously doing something wrong: 

I have created a more simple query to test. I then create a parameter with the xml-file in my folder (pic3) and tried to change the query in the advanced editor as you wrote (pic 4). 

pic3

Udklip3.JPG

 

pic4

Udklip4.JPG

Hello @Anonymous 

 

just delete the quotation marks that are surrounding the parameter

 

Jimmy

Anonymous
Not applicable

Did so and now it gives me 

Udklip5.JPG

Hello @Anonymous 

the query should treat an xml-file, but your query starts from a folder. So probably you have to remove also the function Folder.Contents from your parameter.. that it looks like Xml.Tables(Filename),

 

Jimmy

Anonymous
Not applicable

Thanks! @Jimmy801 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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 Kudoed Authors