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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors