MINX
The smallest value of an expression over a table's rows; with TRUE as a third argument, text and numbers compare as ORDER BY sorts them.
Group: Aggregation. Compatible with DAX.
Syntax
MINX ( <table>, <expression> [, <variant>] )
| Parameter | Type | Description |
|---|---|---|
table | Table | The rows to go through. |
expression | Expression evaluated for each row | The value worked out for each row: a number, a date or text. |
variant | Boolean optional | TRUE to allow results of different types, numbers and texts, compared in the order a sort puts them; FALSE or left out to keep to one type. |
Returns
Same type as its results. The smallest of the expression's results, blanks left out.
Remarks
- Over an empty table, or when every result is blank, the answer is BLANK.
- A blank result is skipped, not taken as zero: the smallest of 3, blank and 5 is 3.
- Text is compared without regard to case.
Examples
Blanks are skipped
EVALUATE
ROW ( "Smallest", MINX ( DATATABLE ( "Value", INTEGER, { { 3 }, { BLANK () }, { 5 } } ), [Value] ) )
| Smallest |
|---|
| 3 |
The weakest product's liters
EVALUATE
ROW ( "Fewest liters", MINX ( VALUES ( Products[Product] ), [Liters sold] ) )
| Fewest liters |
|---|
| 169179 |