RecNo(), RowNo()
RecNo and RowNo in Power BI
RecNo numbers input records and RowNo numbers output rows. In Power Query, add an index column before the filter step (RecNo) or after it (RowNo). The model has no row order, so keep the index as a column.
Short answer: Use Table.AddIndexColumn(Source, "RecNo", 1, 1). Its position among the steps decides whether it behaves like RecNo (before filters) or RowNo (after filters).
What it does in Qlik
RecNo() is the 1-based number of the record read from the current source, counted before WHERE. RowNo() is the position in the resulting table. It counts only kept rows and continues when rows are concatenated onto an existing table.
Qlik example
LOAD RecNo() AS SourceLine, RowNo() AS LoadedRow, *
FROM [lib://Data/lines.csv] (txt, utf8, embedded labels, delimiter is ',')
WHERE Amount > 0;Power BI equivalent
Power Query
let
WithRecNo = Table.AddIndexColumn(Source, "SourceLine", 1, 1, Int64.Type),
Filtered = Table.SelectRows(WithRecNo, each [Amount] > 0),
WithRowNo = Table.AddIndexColumn(Filtered, "LoadedRow", 1, 1, Int64.Type)
in
WithRowNoGotchas and behaviour differences
- An index column stops query folding on most sources, so add it as late as possible, or compute
ROW_NUMBER()in SQL. - DAX tables have no reliable physical order. For ranking or numbering in visuals, use
RANKX, or the window functionROWNUMBER, with an explicit order. - Incremental refresh partitions number rows separately, so an index is not unique across partitions.
Official documentation
- RecNo - script function (Qlik Help)
- RowNo - script and chart function (Qlik Help)
- Add an index column (Microsoft Learn)
- ROWNUMBER function (DAX) (Microsoft Learn)
Related pages
Peek(field_name [, row_no [, table_name]])
Peek (running balances in the script)
Peek reads a field from a row already loaded into the output table. It is used for running balances and for reading values into variables. Power Query has no row-by-row state, so use grouped list logic, a SQL window function upstream, or a DAX measure.
Partial / different approach
Previous(expr)
Previous (compare with the previous input row)
Previous returns an expression's value from the previous input record. Power BI has no LAG in Power Query, so use the index-shift self-merge pattern, a SQL LAG upstream, or a DAX calculated column that finds the previous value.
Partial / different approach
Concatenate [(table)] LOAD ...
Concatenate (append tables)
Concatenate appends rows to an existing table. Qlik also does this automatically when field sets match. Power Query's Append queries (Table.Combine) matches columns by name and fills missing ones with null.
Direct equivalent
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.