Downloads
DAXAggregationIntermediate

MINX

Evaluates an expression on each row of a table and returns the smallest result.

Syntax
MINX(<table>, <expression>)

Returns: A value (a scalar). BLANK when there are no values in the table.

What it does

MINX visits each row of a table, works out an expression for that row, and reports the smallest of those results. It is MIN for calculations. Use it when the value you want to compare is not stored in one column, such as a margin percentage for each product or a balance for each customer.

Syntax and arguments

Example

The category manager wants to know which product has the lowest gross margin percentage in the current view.

Lowest Product Margin % =
MINX(
    VALUES(Product[ProductName]),
    [Gross Margin %]
)

VALUES gives one row per product in context. For each product, the margin percentage is calculated for that product alone, and MINX returns the lowest one. Pair it with a card that shows the name of the product, found with a separate measure, to name the weakest product.

Example: a second, different use

The lowest margin on any single sales line, to find pricing errors:

Thinnest Line Margin =
MINX(
    Sales,
    Sales[SalesAmount] - Sales[TotalCost]
)

Each line is compared on its own margin, so one bad price on one line shows up even if the total margin looks healthy.

Things to watch

In business terms

MINX shows the weakest item in a group: the lowest margin product, the smallest balance in a receivables list, or the lowest utilization in a team of consultants. Used with a name lookup, it tells the reader where to look first.

Related functions

All DAX functions · View as Markdown · DAX fundamentals