SET vSales = Sum(Sales); LET vToday = Today();

Variables (SET, LET and $-expansion) in Power BI

Qlik variables hold expressions, values and settings, and are expanded as text. Power BI splits these roles: measures for reusable logic, Power Query parameters for load settings, what-if and field parameters for user input, calculation groups for logic applied to many measures, and VAR inside DAX.

Partial / different approach DAX Power Query Modeling

Short answer: SET vSales = Sum(Sales) becomes a measure.A load-time LET becomes a Power Query parameter or step.An input box variable becomes a what-if parameter.A variable that swaps dimensions or measures becomes a field parameter.A variable used as a template such as $(vYTD(Sales)) becomes a calculation group.

What it does in Qlik

SET assigns text as is, and LET evaluates the expression first. $(vName) pastes the text into a script or chart expression before it is evaluated, so variables can hold whole expressions, field names or parameters ($1). Variables are also set from input boxes and buttons.

Qlik example

Qlik script and chart
SET vSales = Sum(Sales);
SET vSalesYear = Sum({<Year = {$1}>} Sales);     // parameterised
LET vMaxYear = Year(Today());

// chart
$(vSales)
$(vSalesYear($(vMaxYear)))

Power BI equivalent

Reusable logic as measures

DAX
Sales = SUM ( Orders[Amount] )

Sales current year =
VAR CurrentYear = YEAR ( TODAY () )          -- VAR = local, evaluated once
RETURN
    CALCULATE ( [Sales], 'Date'[Year] = CurrentYear )

User input (what-if parameter)

DAX
Growth = GENERATESERIES ( 0, 0.2, 0.01 )      -- column is [Value]
Growth Value = SELECTEDVALUE ( Growth[Value], 0 )
-- Modeling > New parameter > Numeric range creates the same table,
-- but renames the column to Growth[Growth] and writes the measure for you
Sales forecast = [Sales] * ( 1 + [Growth Value] )

Load-time settings

Create a Power Query parameter (Home > Manage parameters), for example ServerName or StartYear, and use it in the queries. It can be changed in the service under the semantic model settings.

Gotchas and behaviour differences

  • DAX has no text macro expansion. Logic that builds expressions from strings must be redesigned, usually with field parameters or calculation groups.
  • Measures are evaluated in the filter context of each cell. A Qlik variable evaluated with = once for the whole sheet behaves differently from a measure that is evaluated per row.
  • Power Query parameters are fixed per refresh, so report users can't change them. The exception is a dynamic M query parameter bound to a slicer, which works only with DirectQuery sources that support it.

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.