To import multiple Excel files into Power BI, use the Folder connector rather than importing individual files. This method allows Power BI to treat an entire directory as a single data source, automatically stacking (appending) files with the same structure into one master table. This is the most efficient way to handle monthly or daily reports that share the same columns and formatting.

What You'll Need

  • Power BI Desktop installed on your computer.
  • A dedicated folder on your local drive or a network share containing only the Excel files you wish to import.
  • Excel files that share a consistent structure (identical column headers and data types).
  • The files should ideally be saved in the same format (e.g., all .xlsx or all .csv).

Step-by-Step

  1. Organize Your Source Folder: Before opening Power BI, move all the Excel files you want to combine into one specific folder. Ensure no other files (like PDFs or unrelated spreadsheets) are in this folder, as Power BI will attempt to process every file it finds in that directory.
  2. Connect to the Folder: Open Power BI Desktop. On the Home ribbon, select Get Data. From the dropdown menu, select More.... In the search box, type "Folder" and select the Folder connector, then click Connect.
  3. Browse to the Folder Path: A dialog box will appear asking for the folder path. You can either browse to the folder on your computer or paste the file path directly into the text box. Once the path is set, click OK. (Note: Menu labels may vary slightly depending on your version of Power BI Desktop).
  4. Preview the File List: Power BI will now display a list of all files found in that folder. You will see columns for Name, Extension, Date accessed, and other metadata. Do not click Load yet; instead, click Combine and then select Combine & Transform Data. This allows you to clean the data before it enters your model.
  5. Select the Sample File: The Combine Files dialog will open. Power BI needs a "Sample File" to understand the structure of the data it is about to import. By default, the first file in the folder is selected. If your files contain multiple sheets or tables, select the specific sheet name or table from the list on the left. Once the correct sheet is highlighted, click OK.
  6. Clean Data in Power Query: You are now in the Power Query Editor. Power BI has automatically created a "Helper Query" and a main query that appends all files. You will notice a new column called Source.Name, which tells you which file each row of data came from. You can rename this column to "Month" or "Store Location" if the filenames contain useful information.
  7. Verify Data Types: Check the top of each column to ensure the data types are correct (e.g., Date, Decimal Number, or Text). If Power BI misidentified a column, right-click the column header, select Change Type, and choose the correct format.
  8. Apply and Close: Once the data looks correct and the files are stacked properly, click Close & Apply in the top-left corner of the Power Query window. Power BI will now load the combined data into your data model, and you can begin building your visualizations.

Common Mistakes

One of the most frequent errors is having inconsistent column headers. If File A has a column named "Revenue" and File B has it named "Total Revenue," Power BI will not recognize them as the same column. Instead, it will create two separate columns in your final table, leaving null values where the data doesn't match. Always ensure headers are identical across all files.

Another common mistake is leaving "junk" files in the source folder. If you save a temporary backup file or a "Notes.xlsx" file in the same folder, Power BI will try to combine it. This often leads to errors during the "Combine" phase because the backup file doesn't match the schema of the primary data files. Keep your source folder strictly limited to the data files intended for the report.

Users also frequently forget to check the "Sample File" selection. If the first file in your folder is an older version with a different layout, the entire import will fail or result in missing columns for all subsequent files. Always verify that the sample file is representative of the current data structure.

Tips

To make your reports dynamic, use the Source.Name column. Since this column contains the filename, you can use the "Split Column" feature in Power Query to extract dates or categories from the filename itself. For example, if your files are named "Sales_January.xlsx" and "Sales_February.xlsx," you can split the column by the underscore to create a dedicated "Month" column for your axis labels.

If you plan to add new files to the folder every month, you don't need to repeat the import process. Simply save the new Excel file into the folder and click the Refresh button on the Home ribbon in Power BI. The software will automatically scan the folder, find the new file, apply the same transformation steps, and append it to the bottom of your existing table.

For better performance with very large datasets, consider converting your Excel sheets into Excel Tables (Ctrl+T) before importing. When you select a Table instead of a Sheet in the Combine dialog, Power BI only imports the data within that table range, ignoring any empty rows or random notes written outside the table boundaries on the spreadsheet.

Troubleshooting

If you encounter an error stating that the "column cannot be found," it is almost always due to a header change in one of the files. To fix this, go back into Transform Data, look at the "Applied Steps" pane on the right, and check the "Promoted Headers" or "Changed Type" steps. You may need to remove the "Changed Type" step if it is referencing a column name that no longer exists in a newly added file.

If the import is taking an unusually long time or crashing, check the file sizes. Power BI handles large amounts of data well, but hundreds of individual Excel files can slow down the connection. If this happens, try to consolidate your files into fewer, larger workbooks or move the files to a cloud location like SharePoint or OneDrive and use the SharePoint Folder connector instead of the local Folder connector.

If some files are being ignored during the import, check the file extensions. If most files are .xlsx but one is .xls or .csv, the Combine process may skip the outlier. Ensure all files in the folder share the exact same file extension. If you have mixed formats, you will need to create separate queries for each file type and then use the "Append Queries" feature to join them manually.

Frequently Asked Questions

Can I import files from different folders?

The Folder connector only works for a single directory. If your files are spread across different folders, you must either move them into one folder or import each folder separately and use the "Append Queries" feature in Power Query to stack them.

What happens if I delete a file from the folder?

The next time you click Refresh, Power BI will scan the folder and notice the file is missing. The data from that deleted file will be removed from your report visualizations automatically.

Do the files need to be open to refresh the data?

No, the files should be closed. While Power BI can often read open files, it is safer to have them closed to avoid "file in use" errors or locking conflicts during the refresh process.

Can I filter which files are imported from the folder?

Yes. In the Power Query Editor, before clicking "Combine Files," you can use the filter arrow on the "Extension" or "Name" columns. For example, you can filter the Name column to only include files that "Begin with" the word "Sales," ignoring any other files in the directory.

Will this work with CSV files?

Yes, the process is nearly identical. Select the Folder connector, then choose "Combine & Transform." Power BI will recognize the CSV delimiter (usually a comma) and stack the files based on the column positions.