MINX

Updated on

MINX is a DAX function that returns the smallest value resulting from evaluating an expression for each row in a table.

Syntax

MINX(
   Table,
   Expression,
   Variant
)
Argument Properties Description
Table The table containing the rows for which the expression will be evaluated.
Expression The expression to be evaluated for each row of the table.
Variant Optional If true, minimum value in col will be same as order by variant asc column. Default is false.

Return Values

The lowest value.

Remarks

  • The MINX function takes as its first argument a table or an expression that returns a table. The second argument contains the expression that is evaluated for each row of the table.

  • Blank values are skipped. TRUE/FALSE values are not supported.

  • If the expression has variant or mixed value types such as text and number, then by default MINX considers only numbers. If <variant> = TRUE, the minimum value is returned.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example 1

The following example filters the InternetSales table and returns only rows for a specific sales territory. The formula then finds the minimum value in the Freight column.

= MINX( FILTER(InternetSales, [SalesTerritoryKey] = 5),[Freight])

Example 2

The following example uses the same filtered table as in the previous example, but instead of merely looking up values in the column for each row of the filtered table, the function calculates the sum of two columns, Freight and TaxAmt, and returns the lowest value resulting from that calculation.

= MINX( FILTER(InternetSales, InternetSales[SalesTerritoryKey] = 5), InternetSales[Freight] + InternetSales[TaxAmt])

In the first example, the names of the columns are unqualified. In the second example, the column names are fully qualified.

Other functions related to MINX are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/minx-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy