Finding the Minimum Value of an Expression Using MINX in DAX

September 28, 2026 102 visits

In this article, we will learn how to use MINX in DAX to evaluate an expression for every row of a table and return the minimum result. This is especially useful when the minimum value needs to be calculated from an expression rather than directly from a single column.

📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist

What Is MINX in DAX?

MINX is an iterator function in DAX that evaluates an expression for each row of a table and returns the smallest value produced by that expression.

The basic syntax is:

DAX Syntax
MINX(
    <Table>,
    <Expression>
)

The first argument specifies the table that MINX should iterate through. The second argument is the expression that DAX evaluates for each row.

Key takeaway:
MINX does not simply find the minimum value of one column. It evaluates an expression row by row and then returns the minimum result.

1. Retrieving the Source Table

Query

DAX Query
EVALUATE
    MaxMinTable

Step-by-step explanation

Step 1: EVALUATE
EVALUATE tells DAX that we want to return the result of a table expression.

Step 2: MaxMinTable
MaxMinTable is the table used in this example. Returning the table first allows us to inspect the values available in Column A and Column B.

What will you get?

The result displays the rows from MaxMinTable, including the values of Column A and Column B.

Column A Column B
10 20
5 30
15 8

The values above are only for illustration. Your actual result depends on the data in MaxMinTable.

Key takeaway:
The first query helps us understand the source data before applying the MINX expression.

2. Finding the Minimum Result of an Expression

Query

DAX Query
EVALUATE
    ROW(
        "Min Difference", MINX(MaxMinTable, [Column A] + [Column B])
    )

Step-by-step explanation

Step 1: EVALUATE
EVALUATE returns the result of the table expression.

Step 2: ROW
ROW creates a single-row table. In this query, we use it to return one calculated result with the name Min Difference.

Step 3: “Min Difference”
This is the name assigned to the output column. It describes the result that we are calculating.

Step 4: MINX(MaxMinTable, …)
MINX iterates through every row of MaxMinTable.

Step 5: [Column A] + [Column B]
For each row, DAX adds the value from Column A to the value from Column B. MINX then compares all of these calculated results and returns the smallest one.

How MINX evaluates the expression

Suppose the table contains the following values:

Column A Column B Column A + Column B
10 20 30
5 30 35
15 8 23

MINX evaluates the expression [Column A] + [Column B] for each row and obtains 30, 35, and 23.

It then returns the smallest result, which is 23.

What will you get?

Min Difference
23
Key takeaway:
MINX first evaluates the expression for every row and then returns the minimum value from those calculated results.

Understanding the Difference Between MIN and MINX

One important concept is the difference between MIN and MINX.

Function How it works
MIN Returns the minimum value directly from a column.
MINX Evaluates an expression for each row and returns the minimum calculated result.

For example, if you only want the smallest value in Column A, you can use:

DAX Query
EVALUATE
    ROW(
        "Minimum Column A", MIN(MaxMinTable[Column A])
    )

But if you want to calculate an expression such as Column A + Column B for every row and then find the smallest result, MINX is appropriate.

DAX Query
EVALUATE
    ROW(
        "Min Difference", MINX(MaxMinTable, [Column A] + [Column B])
    )

Why Is MINX Useful?

MINX becomes useful when the value you want to minimize is not stored directly in a single column.

For example, you can use MINX when the calculation involves:

  • Adding multiple columns.
  • Subtracting one value from another.
  • Calculating a price after applying a discount.
  • Calculating a cost or margin for each row.
  • Evaluating a more complex row-level expression.

📝 Practice Exercise

Using the MaxMinTable table, write a DAX query that calculates the minimum value of:

  • Column A + Column B

Return the result using ROW with the output column named Minimum Value.

Expected Query

DAX Query
EVALUATE
    ROW(
        "Minimum Value", MINX(MaxMinTable, [Column A] + [Column B])
    )

Important Notes

1. MINX is an iterator

MINX processes the table row by row and evaluates the expression in the context of each row.

2. The expression can involve multiple columns

The expression passed to MINX does not have to be a single column. In this example, we use [Column A] + [Column B].

3. MINX returns one scalar value

Although MINX iterates over a table, the final result is a single minimum value.

4. ROW converts the result into a table output

Because a DAX query using EVALUATE must return a table expression, ROW is used here to return the calculated scalar value as a one-row, one-column table.

Key takeaway:
The combination of MINX and ROW is useful when you want to display the minimum result of a calculated expression as a DAX query result.

Conclusion

In this article, we learned how to find the minimum value of an expression using MINX in DAX.

  • MINX iterates through a table row by row.
  • The expression is evaluated separately for every row.
  • MINX returns the smallest calculated result.
  • ROW can be used to return the scalar result as a table.
  • MINX is useful when the minimum value depends on a calculation rather than directly on one column.

In this example, MINX(MaxMinTable, [Column A] + [Column B]) calculates the sum of Column A and Column B for every row and returns the smallest sum.

Next: The same iterator concept can be used with MAXX to find the maximum result of an expression.


📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist