Domain 1 β€” Module 7 of 7 100%
7 of 26 overall
Domain 1: Prepare the Data Free ⏱ ~11 min read

Data Loading & Query Optimisation

Configure how Power Query loads data into your model, understand query folding, and learn best practices for efficient data loading and refresh performance.

Getting data into the model efficiently

Simple explanation

Think of a delivery truck route.

A smart driver plans the route before leaving β€” avoiding traffic, combining nearby stops, skipping unnecessary detours. The result: faster delivery, less fuel.

Power Query works the same way. Query folding pushes your transformations back to the data source (like letting the warehouse sort packages before loading the truck). Load settings control which queries actually enter your model and which are just staging steps. Together, they determine how fast your data refreshes.

Load settings: what enters the model?

Not every query in Power Query needs to load into your data model. Some queries are just staging steps β€” intermediate transformations that feed into other queries.

Nadia at Prism Agency (πŸ“Š) has this query structure:

QueryPurposeShould It Load?
RawGoogleAdsImport from APINo β€” staging only
RawMetaAdsImport from APINo β€” staging only
CleanedCampaignsAppend + clean both sourcesYes β€” this is the final table
Dim_ClientsClient dimensionYes

How to disable loading:

  • Right-click a query β†’ uncheck Enable Load
  • This keeps the query available as a data source for other queries but doesn’t add it to the model
Exam tip: staging queries

Staging queries that are only used as inputs to other queries should have Enable Load unchecked. This keeps your model lean and avoids loading duplicate data.

On the exam, if you see a scenario where β€œunnecessary tables appear in the model” or β€œthe model is too large”, look for queries that should be staging-only (disable load) rather than loaded tables.

Query folding: let the source do the work

Query folding is when Power Query translates your M steps into a native query that runs on the data source.

How it works

Without FoldingWith Folding
Power BI downloads ALL 5 million rowsPower BI sends SELECT ... WHERE Region = 'North' GROUP BY ...
Filters and transforms happen in Power BI’s memoryFilters and transforms happen on the SQL Server
Slow refresh, high memory usageFast refresh, minimal data transferred

Which steps fold?

Folds (pushed to source)Breaks folding
Filter rowsAdd Index Column
Remove columnsMerge Columns (sometimes)
Sort rowsCustom M functions
Group ByOperations referencing other queries
Change data typeTable.Buffer()
Rename columnsComplex conditional columns

Checking if folding occurs

Right-click any step in the Applied Steps pane:

  • β€œView Native Query” is available β†’ folding IS happening (you can see the SQL)
  • β€œView Native Query” is greyed out β†’ folding has broken at or before this step

Kenji at Apex Manufacturing (🏭) filters his 10-million-row factory data to only the current year. With folding, this sends WHERE Year = 2026 to SQL Server β€” only 800,000 rows travel to Power BI. Without folding, all 10 million rows download first, then Power BI filters locally.

Best practice: order your steps for maximum folding

Put foldable steps first (filters, column removal, type changes) before non-foldable steps (custom columns, index columns). Once folding breaks at a step, all subsequent steps run locally.

Think of it like a chain β€” once one link breaks, everything after it falls.

Example ordering:

  1. Filter to current year ← folds
  2. Remove unnecessary columns ← folds
  3. Change data types ← folds
  4. Add Index Column ← breaks folding
  5. Conditional Column ← runs locally (after the break)

Data load best practices

PracticeWhy It Matters
Disable load for staging queriesReduces model size and refresh time
Filter rows earlyLess data to process in later steps
Remove unused columnsSmaller model, faster VertiPaq compression
Maximise query foldingPush work to the source database
Use reference queries wiselyShare common cleaning steps without re-processing
Set appropriate data types before loadingAvoids implicit conversions in the model
Avoid loading duplicate dataIf two queries load the same rows, consolidate them

M code: the language behind Power Query

Every step you create in the Power Query UI generates M code. You can view and edit it in the Advanced Editor (View β†’ Advanced Editor).

Dr. Ethan Moss at Bayview Medical Centre (πŸ₯) occasionally edits M code directly for transformations the UI can’t handle β€” like custom date parsing for HL7 medical data formats.

You don’t need to memorise M syntax for the PL-300 exam, but you should:

  • Know that M is the underlying language
  • Be able to read simple M expressions
  • Understand that the Advanced Editor shows the full query
  • Know that custom M functions can be created for reusable transformations

Knowledge check

Question

What is query folding?

Click or press Enter to reveal answer

Answer

When Power Query translates M steps into native source queries (like SQL), so transformations run on the data source instead of in Power BI. This makes refresh faster and reduces data transfer.

Click to flip back

Question

How do you check if a step folds?

Click or press Enter to reveal answer

Answer

Right-click the step in Applied Steps. If 'View Native Query' is available and shows SQL, the step folds. If it's greyed out, folding has broken.

Click to flip back

Question

What does 'Disable Load' do on a query?

Click or press Enter to reveal answer

Answer

Prevents the query from loading into the data model. The query still runs and can be referenced by other queries β€” it's just not visible as a table in the model.

Click to flip back

Knowledge Check

Kenji's Power Query has these steps in order: (1) Filter to 2026, (2) Add Index Column, (3) Remove 10 unused columns. He notices refresh is slow. What should he change?

Knowledge Check

Nadia has three queries: RawGoogleAds, RawMetaAds, and CleanedCampaigns (which appends both raw queries). All three are loading into the model. What should she do?

Next up: Star Schema and Relationships β€” connect your tables in the data model.