Stop 05 · M Language & Advanced Power QueryTopics · 7/8

Reference vs Duplicate Queries

Part of the Power BI Roadmap

In short

You need monthly totals and a list of top customers from the same cleaned sales table. Copying all the cleaning steps twice is a trap. Referencing builds both from one clean base.

Duplicate copies all steps into an independent query, while Reference creates a new query that starts from the original's output and updates when it changes.

The jaadu stands between a photocopier spitting out a frozen copy of a notice and a corkboard where a friend points at the original being updated.

Think of it like this

Photocopy vs pointing at the notice board

A photocopy of a notice is yours to scribble on, but it never updates when the office changes the original. Pointing a friend to the notice board means they always see the latest version. Duplicate is the photocopy. Reference is pointing at the board.

Watch it happen

One base, many referencing queries

SalesClean
Monthly (Reference)
TopCustomers (Reference)

1/4SalesClean holds every cleaning step once.

The big ideas

What you need to know

Reference

Creates a query whose only first step is Source = OriginalQuery. Changes to the original flow through.

Duplicate

Copies every step into an independent query. Useful for experiments or a different variant.

Disable load on the base

Untick Enable load on staging queries so they feed others without adding a table to the model.

Reference doesn't mean read once

Each referencing query may still evaluate the base separately during refresh, so don't expect it to halve load time.

See it in code

Walk through the code

powerquery
1// Query: SalesClean (Enable load turned off)2//   ... cleaning steps ...3 4// Query: MonthlySales  (Right-click SalesClean > Reference)5let6    Source = SalesClean,7    AddMonth = Table.AddColumn(Source, "Month", each Date.StartOfMonth([OrderDate]), type date),8    Monthly = Table.Group(AddMonth, {"Month"}, {{"Revenue", each List.Sum([Amount]), type number}})9in10    Monthly

1/3The base query does all the cleaning and is not loaded into the model itself.

A referencing query starts with Source = SalesClean and adds only its own steps.

Save yourself the pain

Common mistakes

Oops

Duplicating a query to build a summary, then fixing a bug only in the original.

Do this instead

Reference the cleaned query so every summary inherits fixes automatically.

Oops

Loading the staging query and its referencing queries all into the model.

Do this instead

Turn off Enable load on the staging query unless you really need it as a table.

Your mission

Build a staging query

~20 min

Quick check

You fix a date format bug in Query A. Which query gets the fix automatically?

Go deeper

  1. 1Reference a cleaned base query to build two different outputs.
  2. 2Duplicate a query when you want to experiment safely.
  3. 3Disable load on staging queries that don't need to reach the model.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge