LOAD *, Year(Date) AS Year; SQL SELECT ...;

Preceding LOAD in Power BI

A preceding LOAD lets one LOAD read the output of the LOAD or SELECT below it, without a resident table. Power Query works like this by default. Every applied step takes the previous step as input. The main thing to watch is query folding: early steps that fold run in the database, like the SQL SELECT at the bottom of a preceding-load stack.

Direct equivalent Power Query

Short answer: Write the steps top to bottom in Power Query: Source, then filter, then add columns, then group. Keep the foldable steps first. Right-click a step and choose "View Native Query" to confirm they're pushed down to SQL.

What it does in Qlik

In Qlik, statements stacked above a SQL SELECT or LOAD are evaluated bottom-up. Each LOAD can refer to fields created by the one below, so you can compute a field and reuse it without repeating the expression.

Qlik example

Qlik script
Orders:
LOAD *, If(Margin > 0.3, 'High', 'Low') AS MarginBand;
LOAD *, (Sales - Cost) / Sales AS Margin;
SQL SELECT OrderID, OrderDate, Sales, Cost FROM dbo.Orders;

Power BI equivalent

Power Query

Power Query M
let
    Source  = Sql.Database("srv", "db"),
    Orders  = Source{[Schema = "dbo", Item = "Orders"]}[Data],     // folds
    Cols    = Table.SelectColumns(Orders, {"OrderID", "OrderDate", "Sales", "Cost"}),
    Margin  = Table.AddColumn(Cols, "Margin", each ([Sales] - [Cost]) / [Sales], type number),
    Band    = Table.AddColumn(Margin, "MarginBand", each if [Margin] > 0.3 then "High" else "Low", type text)
in
    Band

Gotchas and behaviour differences

  • A step that can't fold, such as some custom functions, index columns or certain type changes, stops folding for every step after it. Put row filters before it, the same way Qlik developers push WHERE clauses into the SQL SELECT.
  • Division by zero gives Infinity or NaN in M where Qlik gives NULL. Guard with if [Sales] = 0 then null else ....

Official documentation

Related pages

Spotted an error or a better pattern? QlikToDax is maintained by a working BI consultant; corrections are welcome via the About page. Last reviewed 2026-10-25.