RangeMax(Sales, Target, 0)
RangeMax, RangeMin, RangeCount in Power BI
The Range functions aggregate a list of values in one row, not a column. DAX MAX and MIN accept exactly two scalar arguments. For three or more, iterate over a table constructor. Power Query's List.Max, List.Min and List.Count take any list. When Range functions wrap Above(), see the window-function pages instead.
Short answer: Use MAXX({[A], [B], [C]}, [Value]), which skips blanks like RangeMax ignores NULL. Two-argument MAX([Sales], [Target]) is fine only when neither value can be blank. In M, use List.Max({[A], [B], [C]}). To count numeric non-null values, use List.Count(List.RemoveNulls(...)).
What it does in Qlik
RangeMax(e1, e2, ...)returns the highest numeric value among the arguments and ignores NULL and text.RangeMinreturns the lowest.RangeCountcounts the arguments that are numbers or text, skipping NULLs.- With an inter-record argument such as
Above(Sum(Sales), 0, 3), the range is made of several chart rows.
Qlik example
RangeMax(Q1, Q2, Q3, Q4) AS BestQuarter
RangeMin(Sum(Sales), Sum(Target))
RangeMax(Above(Sum(Sales), 0, 12)) // max of the last 12 rowsPower BI equivalent
DAX
Lower of sales and target = MINX ( { [Sales], [Target] }, [Value] ) -- skips a blank target
Best quarter =
MAXX ( { Plan[Q1], Plan[Q2], Plan[Q3], Plan[Q4] }, [Value] )
Max of last 12 months (visual calc) =
MAXX ( WINDOW ( -11, REL, 0, REL, ROWS ), [Sum of Sales] )Power Query
= Table.AddColumn(Source, "BestQuarter",
each List.Max({[Q1], [Q2], [Q3], [Q4]}), type number)
= Table.AddColumn(Source, "FilledQuarters",
each List.Count(List.RemoveNulls({[Q1], [Q2], [Q3], [Q4]})), Int64.Type)Gotchas and behaviour differences
- Two-argument
MAX(a, b)andMIN(a, b)treat BLANK as a real value:MAX(BLANK(), -5)returns BLANK, andMIN([Sales], BLANK())returns BLANK for any positive sales. RangeMax and RangeMin ignore the NULL and return the other value.MAXXandMINXover a table constructor skip blanks, like Qlik. - Columns named Q1 to Q4 usually mean the data should be unpivoted. After CrossTable/Unpivot, a plain
MAXon one column works.
Official documentation
- RangeMax - script and chart function (Qlik Help)
- RangeCount - script and chart function (Qlik Help)
- MAX function (DAX) (Microsoft Learn)
- List.Max (Power Query M) (Microsoft Learn)
- WINDOW function (DAX) (Microsoft Learn)
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
Above(Sum(Sales))
Above, Below, Before and After
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.
Partial / different approach
CrossTable(attribute, data [, n])
CrossTable (unpivot)
CrossTable turns a wide table (for example one column per month) into attribute/value rows. Power Query's Unpivot other columns does the same. Both drop null cells, so row counts usually match.
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.