What is Reference in Power BI?
Referencing a query in Power BI is a simple but powerful technique that helps you build cleaner, more efficient, and easier-to-maintain reports. Instead of redoing your work, you create new queries that build upon a foundation you’ve already established. This guide will walk you through what a Reference is, why it's different from duplicating a query, and how to use it in your own projects.
What Exactly is a "Reference" in Power BI?
In simple terms, a "Reference" is a feature inside the Power Query Editor that lets you create a new query that uses another query as its starting point. Think of it like this: your original query goes through all the work of connecting to a data source and performing a series of cleaning steps (the "Applied Steps"). When you create a reference, the new query doesn't repeat all of those steps. Instead, it simply takes the final, clean output of your original query and uses that as its "Source."
You can create multiple new queries that all reference the same original query. The new, referenced queries have their own set of applied steps and are completely separate from each other, but they all depend on the original query they point to. If you make a change to the original query - say, you fix a misspelled column name - that change automatically flows downstream to all the queries that reference it.
This creates a parent-child relationship between your queries:
- The Original (Parent) Query: This is your base query. It connects to the actual data source (like an Excel file or SQL database) and contains all your initial transformation steps.
- The Referenced (Child) Query: This new query starts its life using the result of the parent query. It has its own list of Applied Steps, which you add separately.
Why Use Reference? The Key Benefits
Using references might seem like a small detail, but it can dramatically improve your workflow and the quality of your data models. It's a standard practice for experienced Power BI developers for several good reasons.
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.
1. Keep Your Data Model Clean and Organized
Working in the Power Query Editor can get messy, fast. Using references helps you structure your transformations logically. You can create a "staging" or "base" query that does all the heavy lifting of importing and cleaning the raw data. You might even want to disable the loading of this base query to the final data model, so it only exists as a reusable building block within Power Query. Then, you can create multiple, focused "final" queries that reference this base query for specific purposes, like creating summary tables or dimension tables.
2. Save Time and Effort
Imagine you have a master sales table and you need to create five different reports from it. Many of your initial cleaning steps - like renaming columns, removing null values, changing data types, and filtering out test entries - will be exactly the same for all five reports.
Instead of repeating those 10-15 steps in five different queries, you do them just once in your base query. Then, you create five referenced queries. Each one is a fresh slate built on your already-cleaned data, ready for you to add the unique filters or aggregations it needs. This drastically cuts down on repetitive, manual work.
3. Improve Maintainability and Reduce Errors
This is arguably the biggest benefit. Data sources are rarely perfect, and requirements change over time. Let's say you discover that a column in your source data, named 'CustomerID', was incorrectly formatted as text instead of a whole number.
- Without Reference: If you had duplicated your query five times, you would need to find and update the "Change Type" step in all five queries, hoping you remember every single one. If you miss one, you'll have inconsistent data and potential relationship errors in your model.
- With Reference: You simply open the original base query, fix the data type once, and you're done. The fix automatically propagates to all the referenced queries that depend on it. This makes your reports more robust, reliable, and much easier to debug.
Reference vs. Duplicate: What's the Difference?
This is one of the most common points of confusion for people learning Power Query. Both "Reference" and "Duplicate" are options when you right-click a query, but they do fundamentally different things.
Understanding their differences is essential for building effective data models.
Think of it like working with a Google Doc. A "Reference" is like sharing a link to the document, everyone who has the link sees the latest version. A "Duplicate" is like selecting "File" > "Make a copy." Now you have your own version, and any changes you make won't affect the original document at all.
How to Create a Reference in Power Query: A Step-by-Step Guide
Creating a reference is incredibly simple. All it takes is a right-click. Follow these steps:
- Open the Power Query Editor: From Power BI Desktop, click on "Transform data" in the Home ribbon.
- Find Your Base Query: In the "Queries" pane on the left side of the screen, locate the query you want to build upon. This will be your "parent" query.
- Right-Click and Reference: Right-click on the query's name to open the context menu. Select "Reference".
- A New Query Appears: A new query will be created. You'll notice immediately that in the "Applied Steps" pane on the right, its only step is "Source," and the value in the formula bar is simply the name of your original query (e.g., '_SalesData').
- Rename Your Query: This is an important organizational step. Give your new referenced query a descriptive name that reflects its purpose, like "Sales_by_Region" or "Dim_Products".
- Start Transforming: You can now add any transformations you need to this new query (filters, grouping, etc.) without altering the original _SalesData query at all.
Practical Examples: When to Use Reference
Theory is great, but seeing how references solve real-world problems is where the concept truly clicks.
Example 1: Creating Separate Tables for Different Business Segments
Let's say you have one large table All_Transactions, which contains sales data for every product and country. You’ve already done the initial work of cleaning this All_Transactions query.
Your goal is to create separate tables - one for US sales and another for UK sales - so you can analyze them independently.
- Step 1: Create your base query,
All_Transactions, and apply all common cleaning steps (change data types, remove errors, etc.). - Step 2: Right-click
All_Transactionsand select "Reference." Rename the new query toUS_Sales. - Step 3: In the
US_Salesquery, add a new step: filter the 'Country' column to show only "United States." - Step 4: Right-click
All_Transactionsagain and select "Reference." Rename the new query toUK_Sales. - Step 5: In the
UK_Salesquery, filter the 'Country' column to show only "United Kingdom."
Now, if you needed to add a new 'Profit_Margin' calculated column to all transactions, you would add it only to the base All_Transactions query. It will automatically appear in both US_Sales and UK_Sales.
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.
Example 2: Splitting One Table into Fact and Dimension Tables
This is an essential technique in data modeling called "denormalization". Imagine you have a single sales table exported from your e-commerce platform that includes customer information in every row (CustomerID, CustomerName, City, State).
For an efficient data model, you want a lean "Fact Table" (Fct_Sales) with just transaction details and a separate "Dimension Table" (Dim_Customer) with a unique list of customers.
- Step 1: Bring in your
Raw_Salestable and perform common cleaning steps. - Step 2: Reference the
Raw_Salesquery and name itDim_Customer. In this query, keep only the customer-related columns (CustomerID, CustomerName, City, State) and remove the rest. Then, right-click the 'CustomerID' column and select "Remove Duplicates" to get a unique list of every customer. - Step 3: Reference the
Raw_Salesquery again and name itFct_Sales. In this query, keep all the transaction-related columns (Date, OrderID, ProductID, Quantity, Revenue, etc.) and the 'CustomerID' column. Remove the columns you put in the dimension table (CustomerName, City, State).
By using Reference, you’ve cleanly split one table into two connected tables, and both originate from the same cleaned source.
Example 3: Creating Tables with Different Levels of Aggregation
Sometimes you need to see your data from multiple perspectives - a daily view, a monthly summary, and a yearly total.
- Step 1: Create
Daily_Web_Trafficwith all your raw, daily hit data. - Step 2: Reference it to create
Monthly_Web_Traffic_Summary. In this new query, use the "Group By" function to sum your metrics by month. - Step 3: Reference the base query again to create
Traffic_By_Source. Here, you Group By the 'Source / Medium' column to see which marketing channels are driving visits.
All three tables are perfectly in sync because they are fed from the same clean daily data, but they present the information at different levels of detail.
Final Thoughts
Learning to use the "Reference" feature in Power Query will change how you approach building reports in Power BI. By creating modular, dependent queries, you automate updates, reduce errors, and make your data models significantly easier to manage and understand. The next time you find yourself repeating the same cleaning steps in a new query, stop and ask if creating a reference would be a better approach.
Organizing data flows in tools like Power BI is a critical skill, but let’s be honest, it's often the most time-consuming part of a project. When we built Graphed, our goal was to automate these tedious early steps. We handle connecting to your data sources and allow you to ask for dashboards in simple, conversational language. This way, you can focus on exploring insights from your marketing and sales data right away, rather than spending hours just preparing it for analysis.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.