Get Data – From Folder

Written in

by

Connect and append files dynamically!

This is the Excel sequence to append files stored in 1 folder:

Your files must have the same column number and column names!

  1. Data/ Get Data
  2. Browse to the folder storing your files
  3. Click Open, to create the connection to the folder (yes, that’s an empty screen)
  4. Terminate with Combine & Transform Data to apply further transformations in Power Query
 

You can alternatively proceed manually:

  1. Repeat previous steps 1 to 3
  2. Click the “Combine Files” icon showed in Content column (see 1 below)
  3. Highlight a sample file
  4. Terminate with OK

If you chose the manual method, you can review and apply a filter on files metadata.
Pay attention to those icons:

Power Query: Combine Files (1) and Expand icon (2) on imported columns

This slideshow shows how to append files in Excel and Power BI:

Bonus tips: what happens when…

Book1 and Book2 do not have the same column number, but column names are strictly equals:
Book1 selected as Sample file:

Power Query: Combine Files creates nulls

Book2 selected as Sample file:

Power Query: Combine Files adjusts the append to the number of columns of Book2

Book1 and Book2 do have the same column number but different column names:
Book2 selected as Sample file.

Power Query: Combine Files with different column names

Recap

With a bit of practice, the commands shared in this blog are not complex.
The real challenge, to ensure data consistency is to extensively review each file column names.
Just select the file with more columns as Sample to avoid any data loss during the operation.

The link to the official Power Query documentation is here.

Hope you enjoy this content.

Leave a comment