Above(Sum(Sales))
Above, Below, Before and After in Power BI
Above() reads the value from the previous row of the chart. Power BI offers three replacements: the OFFSET window function, the PREVIOUS visual calculation, and calendar-aware time intelligence. Each behaves differently when periods are missing.
What it does in Qlik
Above([TOTAL] expr [, offset [, count]]) evaluates the expression on the row above the current one in the chart's column segment. Below looks down. Before and After do the same across pivot-table columns. The result depends on the chart's sort order, and the first row returns NULL.
Qlik example
Above(Sum(Sales)) // previous row
Sum(Sales) - Above(Sum(Sales)) // change vs previous row
Above(Sum(Sales), 12) // 12 rows up (same month last year, if no gaps)Power BI equivalent
Window function (model measure)
This assumes 'Date'[YearMonth] is a sortable column such as 202401.
Sales previous row =
CALCULATE (
[Sales],
OFFSET ( -1, ALLSELECTED ( 'Date'[YearMonth] ), ORDERBY ( 'Date'[YearMonth], ASC ) )
)Visual calculation
Previous = PREVIOUS ( [Sales] )
Change = [Sales] - PREVIOUS ( [Sales] )Calendar-aware (time intelligence)
Sales previous month = CALCULATE ( [Sales], DATEADD ( 'Date'[Date], -1, MONTH ) )
Sales last year = CALCULATE ( [Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )Gotchas and behaviour differences
Abovemoves by displayed row. If a month has no data and is hidden, Qlik's "previous" is the month before the gap.DATEADDalways uses the calendar.OFFSEToverALLSELECTED('Date'[YearMonth])includes empty months, because it walks the date table.- Put the column used in
ORDERBYon the visual's axis. If the axis shows another column from the same table instead, such as a month name sorted byYearMonthor a text key sorted by an index column, that column's filter stays on every row and the previous row comes back empty. Fix both parts. UseSUMMARIZE(ALLSELECTED('Date'), 'Date'[YearMonth])as the relation, and remove the label column's filter withREMOVEFILTERS('Date'[MonthName])in the surroundingCALCULATE. Also don't callALLSELECTEDinside an iterator such asSUMX, where it returns only the rows being iterated. Compute it in a variable before the iterator. Above(..., 12)for "same month last year" breaks as soon as a month is missing.SAMEPERIODLASTYEARdoes not.- The sort order in a Qlik chart changes what
Abovereturns.OFFSETuses its ownORDERBY, independent of the visual's sort. - Visual calculations have limits that matter when you migrate: you can't filter or sort a visual by them, change their aggregation, or reuse them in another visual. Data exports leave them out. They don't support dynamic format strings or Show items with no data. Slicers, custom visuals and paginated reports don't support them, and you can't pin a visual that uses them to a dashboard or publish it to the web. If any of these matter, use the model measure instead. (Microsoft's list)
- The time intelligence functions need a proper date table with contiguous dates, marked as a date table. See master calendar.
Official documentation
- Above - chart function (Qlik Help)
- Below - chart function (Qlik Help)
- OFFSET function (DAX) (Microsoft Learn)
- Using visual calculations in Power BI Desktop (Microsoft Learn)
- DATEADD (dax.guide)
Related pages
RangeSum(Above(Sum(Sales), 0, RowNo()))
Running totals with RangeSum(Above(...))
The Qlik running-total idiom RangeSum(Above(Sum(Sales), 0, RowNo())) maps to a cumulative DAX measure, a WINDOW function, or the RUNNINGSUM visual calculation.
Partial / different approach
RangeAvg(Above(Sum(Sales), 0, 3))
Moving averages with RangeAvg(Above(...))
RangeAvg(Above(Sum(Sales), 0, 3)) gives a 3-row moving average. In Power BI, use WINDOW with AVERAGEX, the MOVINGAVERAGE visual calculation, or a calendar-based DATESINPERIOD 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
LOAD ... AUTOGENERATE ... WHILE ... IterNo()
Master calendar (date table)
The Qlik master calendar script maps to a date table built in Power Query (List.Dates) or DAX (CALENDAR), marked as a date table and related to the fact date. It is essential for every time-intelligence function.
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.