How to Combine Multiple CSV Files in Power BI

Cody Schneider••8 min read

If you're still manually opening, copying, and pasting data from multiple CSV files to create a single master file, there’s a much better way. Power BI can turn this tedious chore into an automated, one-time setup that saves you hours every week. This guide will walk you through, step by step, how to combine all your CSV files from a single folder into one clean data table using Power BI.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

What Do We Mean by "Combining Files"?

Imagine you have a process that generates a new sales or marketing report every day, week, or month. You might end up with a folder full of files like:

  • January_Sales.csv
  • February_Sales.csv
  • March_Sales.csv

Combining these files involves automatically stacking them on top of one another into a single, unified dataset within Power BI. Instead of manually performing this task every time a new file arrives, you’ll set up a query that does it for you. When April's file is added to the folder, you simply click “Refresh,” and your report is instantly updated.

This approach isn't just about saving time, it's about building scalable and error-proof reports. You set it up once, and it handles the rest, ensuring your data is always consistent and up-to-date.

Before You Begin: Preparing Your CSV Files

The magic in Power BI happens when your files are prepared correctly. Before we jump into the steps, make sure your data setup meets these two simple requirements. A few minutes of upfront organization can save you hours of troubleshooting later.

1. Store Your Files in a Single Folder

Create one dedicated folder on your computer or a shared location (like a OneDrive or SharePoint folder) and place all the CSV files you want to combine inside it. Power BI will point to this folder as its single source of truth. It's also a good idea to remove any files you don't want to include from this location to keep things clean.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

2. Ensure a Consistent File Structure

For the simplest and most effective merge, your CSV files should share the same general structure. This means:

  • They have the same number of columns.
  • The columns have the exact same names. For example, if one file has a column named "Revenue" and another calls it "Sales," you should rename one so they match perfectly before starting. Case sensitivity matters, so "revenue" and "Revenue" are treated as different.
  • The columns are in the same order. While Power BI is smart enough to often handle columns in different orders by matching headers, it’s best practice to keep them consistent to avoid any potential errors.

Example of a Consistent Structure:

January_Sales.csv:

Date,Product,Region,Sales

February_Sales.csv:

Date,Product,Region,Sales

By making sure your files look like this, you're paving the way for a smooth and simple process in Power BI.

Step-by-Step Guide: Combining CSV Files in Power BI

With your files properly organized, you're ready to get to work in Power BI Desktop. We'll be using Power Query, the data transformation tool built into Power BI, to combine the files.

Step 1: Get Data From a Folder

First, you need to tell Power BI where to find your files.

  1. Open Power BI Desktop.
  2. On the Home ribbon, click on Get Data.
  3. In the drop-down menu that appears, click More… to open a list of all data sources.
  4. In the Get Data window, select Folder from the list of options (it's often under the 'All' or 'File' category) and click Connect.

Step 2: Connect to Your Folder

Now, simply navigate to the folder where you stored your CSV files.

  1. Click the Browse… button and select the folder you created in the prep phase.
  2. Once you've selected the folder path, click OK. Power BI will read the metadata of all the files inside.

Step 3: Combine the Files

Power BI will now show you a preview window listing all the files in your selected folder along with some metadata, like the file names, creation dates, and folder paths.

At the bottom of this window, you’ll see a few options: Combine, Load, and Transform Data. Here's your best path forward:

  • Look for the Combine button. It often has a small dropdown arrow next to it.
  • Click this arrow and select Combine & Transform Data.

This option is the most flexible because it takes you directly into the Power Query Editor after combining the files, allowing you to clean, modify, or verify your data before loading it into your data model. Choosing "Combine & Load" skips this step, which is less ideal if you need to perform any data-cleaning actions.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Step 4: Use a Sample File to Set the Rules

Power BI now needs to understand the structure of the files it's combining. To do this, it asks you to pick a "Sample File." It will use the structure of this single file as a template for all the others in the folder.

  • In the new "Combine Files" dialog box, you'll see a preview of what Power BI believes is the first file.
  • You can select a specific file from the dropdown if you want, but sticking with the First File option is usually fine, since you've already ensured they all have the same structure.
  • Click OK.

Power BI gets to work in the background. It will automatically perform a series of steps to merge your files. It's surprisingly fast!

Step 5: Review Your Combined Data in Power Query

When the process is finished, the Power Query Editor will open. You will now see your final, combined data table. Notice a few things:

  • All the rows from "January_Sales.csv," "February_Sales.csv," and so on, are now stacked into one unified table.
  • Power BI automatically adds a new column, usually named Source.Name, containing the original filename for each row. This is incredibly useful! You can now use this column to filter or analyze data based on its source file (e.g., compare sales by month).

On the left-hand Queries pane, you’ll see that Power BI has also created a folder filled with "helper queries." These were generated automatically to create the combine operation - you generally don’t need to touch or edit them. Your main, combined data is in the query named after your folder.

From here, you can perform any additional data cleaning you need, such as changing data types (e.g., ensuring your Sales column is a number and Date column is a date). Once you're happy, click Close & Apply on the Home ribbon.

That's it! Your combined data is now loaded into your Power BI report, ready for you to start building visualizations.

Troubleshooting and Pro Tips

Sometimes things don't go perfectly. Here are a few common scenarios and how to handle them.

What If My Folder Contains Other File Types?

If your folder has Excel files or .txt files mixed in with your CSVs, Power BI might show an error during the combine step. The easiest fix is to filter them out before combining.

In Step 3 (the file preview screen), click Transform Data instead of "Combine." This brings the list of files into Power Query. Here, find the [Extension] column. Click the filter dropdown on that column header and deselect everything except .csv. After filtering, click the Combine Files button (it looks like two arrows pointing down) on the [Content] column header and proceed as normal.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

How Do I Handle Inconsistent Column Names?

If you forgot to align your column headers before starting, the combined table may look messy, with null values where headers didn't match. For example, if one file used "Revenue" and another used "Sales," you would get two separate columns in the final table instead of one merged column.

The best solution is to go back to your source files and make the column names consistent. However, you can also fix this in Power Query by merging the two columns and then removing the originals.

The Joy of Refreshing Your Data

The true power of this method becomes clear when new data comes in. Imagine the next month's report arrives:

  1. Simply save the new April_Sales.csv file into the same folder.
  2. Open your Power BI report and click the Refresh button on the Home ribbon.

Power BI will re-run the entire query, automatically picking up the new file, stacking it at the bottom of your dataset, and updating every single one of your charts and tables. No more opening, copying, or pasting - just one click.

Final Thoughts

You now have a powerful, automated method for combining dozens or even hundreds of CSV files with just a few clicks. This process not only saves you an enormous amount of repetitive work but also makes your data refreshable and your reporting far more reliable.

Setting this up in Power BI is a massive time-saver. That said, we know diving into tools like Power Query isn't always something teams have time for, especially when your data is scattered across many SaaS platforms - not just in CSV files. As an AI-powered data analyst, we help you connect sources like Google Analytics, Shopify, Facebook Ads, or HubSpot and simply ask questions about your data using natural language, allowing us to build your real-time dashboards for you. If you want to skip spreadsheet wrangling and BI tool tutorials altogether, give Graphed a try and turn hours of analysis into a 30-second conversation.

Related Articles