DAX function
MINX / MAXX — DAX function reference
Min/max of a per-row expression.
Syntax
dax
MINX(<table>, <expression>) MAXX(<table>, <expression>)
Examples
dax
MAXX(Sales, Sales[Qty] * Sales[Price])
→ A number
Context transition evaluates the SUM once per category before MAXX picks the largest.
dax
MAXX(VALUES(Product[Category]), CALCULATE(SUM(Sales[Amount])))
→ The best-selling category's total, whatever it is
dax
MINX(ALLSELECTED(Product), [Total Sales])
→ Lowest-selling visible product's total
Common mistakes & gotchas
- MINX/MAXX only trigger context transition when the expression references a measure or is wrapped in CALCULATE — a bare column reference just uses row context.
- The table argument sets the comparison granularity: MAXX(Sales, …) compares row by row, MAXX(VALUES(Product[Category]), …) compares category totals — filtering the wrong table is a common mistake.
Related DAX functions
From Aggregations