Locked lesson.
About this lesson
Power Query adds the ability to reach into a folder and append all files in the folder based on the transformations of a single file. Before you can leverage it, however, you need to learn the background, and that's what this lesson is all about.
Exercise files
There are no related exercise files for this lesson.
Quick reference
Append All Files in a Folder - Theory
An introduction on how to import and combine all the files in a folder at once.
When to use
When you want to append data from each file in a folder without having to process each file manually.
Instructions
The Combine Binaries process
- Create a FilesList staging query
- Connect to the folder
- Filter to only the desired file types to be combined
- Load the query as a Connection Only query
- Combine the binaries
- Reference the FilesList query
- Rename the new “Master” query
- Click the Combine Binaries button
- Delete the Changed Type step (to prevent it erroring after modifying the Transform Sample)
- Modify the Transform Sample
- Select the Transform Sample query
- Transform the data as needed
- Finalize the Master query
- Return to the Master query
- Modify the Removed Other Columns1 step to keep any desired file properties
- Add any additional transformation steps required to the Master query
- Set the Data Types
- Finalize the query by loading it to the desired location
This Combine Binaries setup allows us to
- Only hard code the file path into the solution once (the Source step of the FilesList query)
- Apply transformations before the data is combined in the Master Query (pre-aggregation)
- Apply other transformations after the data is combined in the Master Query (post-aggregation)
- Preserve file properties that may not be part of the data files being combined
Hints & tips
- The only queries that we ever modify in this technique are the:
- File Listing
- Transform Sample
- Master Query
Lesson notes are only available for subscribers.