How to Combine Two Power BI Files

Cody Schneider9 min read

Trying to merge two Power BI files into one can feel like a data puzzle with no clear solution. You might have a sales report for the first quarter in one .pbix file and a report for the second quarter in another, and you just want a single, year-to-date view. This article will show you the right way to merge Power BI reports, focusing on creating a clean, scalable, and easy-to-manage master file. We'll skip the common mistakes and get straight to the methods that actually work.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

First, Why You Can’t Just Copy and Paste Visuals

The most tempting approach is to open both Power BI files, select all the visuals on a page in one, and paste them into the other. While this seems quick, it's a huge mistake that creates far more problems than it solves. Stick with this method, and you’ll soon find yourself in a reporting mess.

Here’s why copy-pasting is a bad idea:

  • Disconnected Data Models: When you copy a visual, Power BI also copies the underlying queries, DAX measures, and data model tables associated with it. This leads to a bloated, confusing master file with duplicate tables and a tangled web of relationships that are almost impossible to manage.
  • Broken Measures and Relationships: DAX measures often break during the copy-paste process because their table references get mixed up. You'll spend hours fixing DAX formulas and trying to figure out which "Sales" table a measure is supposed to be pointing to.
  • Performance Nightmares: Duplicating all that data means your file size skyrockets. Your single report now loads the same data multiple times, which slows everything down and makes interacting with your dashboard sluggish.
  • Maintenance Headaches: Future updates become a chore. If you need to change a query or a calculation, you have to remember to do it in multiple places. It’s inefficient and a recipe for creating inconsistent data.

The core principle is this: you need to combine the data sources and queries, not the finished charts. A healthy Power BI report has one clean, well-structured data model. Our goal is to bring the data logic from two files into one, then rebuild the visuals on top of that unified model.

The Right Way: Combining Power BI Files in Power Query

The best way to merge two projects is by working inside Power Query (the "Transform Data" window). This is where all the data import and transformation instructions - the "recipes" for your data - are stored. By consolidating these recipes, you create a single source of truth for your final report.

There are two primary scenarios you'll likely encounter:

  1. The files use the exact same data source structure (e.g., Q1 Sales and Q2 Sales that have identical columns).
  2. The files use different but related data sources (e.g., Salesforce sales data and Shopify website data that need to be linked by date).

We'll walk through both.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 1: Combining Files with the Same Structure

This is the most common scenario. Imagine you have a Sales_Q1.pbix file and a Sales_Q2.pbix file. They connect to the same database tables or SharePoint folder and contain identical query structures.

Here is your step-by-step process to merge the logic and data.

Step 1: Choose Your "Master" File

Designate one of your two files as the final, combined file. Usually, this would be the most recent one. For our example, let's make Sales_Q2.pbix the master file, and we’ll pull in the queries from Sales_Q1.pbix. It's a good practice to save a copy of this master file with a new name, like Sales_YTD.pbix, before you begin.

Step 2: Copy the M Code from the Secondary File

M code is the programming language that Power Query uses behind the scenes to record every step you take to clean and transform your data. We're going to grab this recipe from your secondary file.

  1. Open your secondary file (Sales_Q1.pbix).
  2. Click on the Transform Data button in the Home ribbon to open the Power Query Editor.
  3. In the Queries pane on the left, you’ll see a list of all your queries. Click on the query whose logic you want to transfer.
  4. With the query selected, go to the View tab in the ribbon and click on Advanced Editor.
  5. A new window will pop up containing the M code for that query. This code details everything from the data source to the last transformation step.
  6. Select all the code (Ctrl + A) and copy it (Ctrl + C).

Step 3: Paste the M Code into Your Master File

Now, let’s add that query recipe to your main report.

  1. Open your master file (Sales_YTD.pbix).
  2. Go to Transform Data to open the Power Query Editor again.
  3. In the Home ribbon, click on New Source and select Blank Query. This creates an empty container for your M code.
  4. A new query, likely named "Query1," will appear on the left. Make sure it's selected.
  5. Go back to the View tab and click Advanced Editor.
  6. A window with a small bit of default code will appear. Delete everything in that window.
  7. Paste (Ctrl + V) the M code you copied from your first file. Click Done.

You’ll notice the blank query immediately transforms into a duplicate of the query from your first report. Rename it to something logical (e.g., SalesData_Q1).

Repeat this copy-paste process for any other queries you need to bring over from your secondary file.

Step 4: Append the Queries (If Necessary)

Now that both queries (SalesData_Q1 and SalesData_Q2) are in your single PBIX file, you may want to combine them into one table.

  1. In the Power Query Editor, go to the Home tab.
  2. Select your primary query, such as SalesData_Q2.
  3. Click the Append Queries dropdown button. If you just want to add the Q1 data to the Q2 table permanently, choose Append Queries. If you'd prefer to create a brand new, combined table, choose Append Queries as New. The latter is usually safer.
  4. In the dialog that appears, select the table you want to append (SalesData_Q1). Click OK.

You'll now have a new query that stacks the rows from both queries on top of each other, giving you a year-to-date table.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 5: Check Your Data Model and Relationships

Once you’re done in Power Query, click Close & Apply on the Home ribbon.

Power BI will now load the data from your newly added queries. Crucially, it will not automatically recreate the relationships. You need to do this manually.

  1. Go to the Model View on the left-hand panel of Power BI Desktop.
  2. You'll see your new tables floating unconnected to your existing tables (like your Calendar or Product tables).
  3. Drag the key columns to create the right relationships. For example, drag the [Date] column from your newly appended sales table to the [Date] column on your Calendar table.

Always double-check that your relationships are correctly configured (one-to-many, etc.). After this, you can start building or updating visuals using your new-and-improved combined data model!

Method 2: Combining Files with a Common Dimension

What if your files aren’t identical? Say you have a SalesForce.pbix file tracking deals and a Shopify.pbix file with website revenue data. Both contain valuable information that needs to be analyzed together, linked perhaps by a date table and a product table.

In this case, the process is similar but focuses on establishing shared "dimension tables".

Step 1: Identify and Designate a Master File

As before, pick one file to be your master. Let's make SalesForce.pbix our main report and bring in the Shopify data.

Step 2: Consolidate Your Queries

Following the same steps from Method 1, use the Advanced Editor to copy the M code for your core data queries from the Shopify.pbix file (e.g., ShopifyOrders, Products) and paste them as new blank queries into your master file's Power Query Editor.

Step 3: Build or Validate a Shared "Dimension Table"

For your two data sets to talk to each other, they need a common reference point. A Date Table is the most common example. Your sales data has a Close_Date and your Shopify data has an Order_Date.

You need to create a single, authoritative Calendar table in your master file if you don't already have one. This is non-negotiable for good data modeling. You can create this using DAX's CALENDARAUTO() or CALENDAR() functions, or import it from a source like Excel. This Calendar table should have relationships to both your Salesforce data and your Shopify data.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 4: Create a Clean Star Schema Model

Once you click Close & Apply and all your data is loaded, head to the Model View.

Your goal is to build a star schema, where dimension tables (like Calendar, Products, Customers) are in the center, and your fact tables (Salesforce Data, Shopify Orders) link to them. A fact table should never be directly related to another fact table.

Connect your shared dimension tables to your newly imported fact tables. For instance:

  • Drag Calendar[Date] to SalesforceData[Close_Date]
  • Drag Calendar[Date] to ShopifyOrders[Order_Date]

With this setup, you can put visuals from both Shopify and Salesforce on the same report page and filter them using a single date slicer that's tied to your master Calendar table. This creates a powerful, unified view of your entire business operation.

Final Thoughts

Combining Power BI files is all about consolidating the underlying data models, not copying and pasting visuals. By using Power Query to merge query logic, create a single clean data model, and re-establish the correct relationships, you build a reporting solution that is reliable, performant, and easy to maintain.

We know that managing M code and data models in Power BI involves a lot of manual steps and has a steep learning curve. The complex process is exactly why we built Graphed. We connect directly to all your data sources - like Salesforce, Shopify, Google Analytics, and Facebook Ads - and merge them automatically. Instead of having to mess with the Advanced Editor and re-build relationships, you can just describe the combined dashboard you want in plain English and our AI builds it in seconds, giving you back hours of your time.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!