Power BI MAX and MIN Functions: MAX, MAXA, MAXX, MIN, MINA and MINX in DAX

When I build a Power BI report, I almost always need a highest or lowest value somewhere: the latest order date, the best test score, the shortest delivery time, or the top sale for one product. DAX has six functions for this, and picking the right one saves a lot of head-scratching.

In this tutorial, I’ll explain MAX, MAXA, MAXX, MIN, MINA and MINX with simple examples, show when to use each one, and cover the real cases I get asked about most, like the max value per category and comparing two measures.

Quick answer: Use MAX(Table[Column]) or MIN(Table[Column]) for the highest or lowest value in a column. Use MAXX(Table, Expression) or MINX(Table, Expression) when you need to calculate something for each row first, or filter the rows. Use MAXA and MINA when the column holds TRUE/FALSE values.

MAX, MIN, MAXX and MINX at a glance

FunctionSyntaxUse it when
MAXMAX(<column>) or MAX(<expr1>, <expr2>)You want the largest number, date or text in a column, or the larger of two values
MINMIN(<column>) or MIN(<expr1>, <expr2>)You want the smallest value, or the smaller of two values
MAXAMAXA(<column>)The column has logical values (TRUE counts as 1, FALSE as 0)
MINAMINA(<column>)Same as MAXA, for the smallest value
MAXXMAXX(<table>, <expression>[, <variant>])You calculate a value per row, or filter the table, before taking the largest
MINXMINX(<table>, <expression>[, <variant>])Same as MAXX, for the smallest

All six work in measures and calculated columns. MAX and MIN also work in visual calculations, which I cover near the end.

If you know the DAX SUM and SUMX functions or AVERAGE, AVERAGEA and AVERAGEX, the pattern is the same: a plain version, an A version and an X version.

The sample data

For most examples, I use a small table named Sheet with products, sales, order dates and profit:

ProductSalesOrder dateProfit
AAA2002/02/20265
BBB3012/02/202610
CCC6002/28/202620
DDD8006/03/202620
EEE10008/03/202640
FFF12003/18/202660
CCC6012/04/202610
BBB3004/14/202611
AAA8005/18/20269

To add each measure, select the table in the Data pane, select New measure on the ribbon, type the formula and press Enter. Then show it in a Card visual. If measures are new to you, start with these Power BI measure examples.

MIN and MAX

MIN and MAX return the smallest or largest value in a column. They work with numbers, dates and text, and they ignore blank cells.

Numbers

Lowest profit = MIN(Sheet[Profit])
Power BI MIN measure returning the lowest profit
Highest sales = MAX(Sheet[Sales])
Power BI MAX measure returning the highest sales value

The lowest profit is 5 and the highest sale is 120.

Dates

Earliest order date = MIN(Sheet[Order date])

Latest order date = MAX(Sheet[Order date])

With the sample data, the earliest order date is 02/02/2026 and the latest is 12/04/2026. This is the most common use of MAX in my reports, for example to show “Data as of” in a card.

For more date measures, such as the number of days since the last order, see Power BI measure date examples.

Text

For text, MIN and MAX compare alphabetically, so MIN returns the first product name and MAX the last:

First product = MIN(Sheet[Product])
Power BI MIN measure on a text column returning the first product name
Last product = MAX(Sheet[Product])
Power BI MAX measure on a text column returning the last product name

Compare two measures

The second form of MIN and MAX takes two expressions and returns the smaller or larger one. It’s handy for comparing two measures. First, create the two measures:

Total profit = SUM(Sheet[Profit])

Total sales = SUM(Sheet[Sales])

Then compare them. Notice that you refer to the measures by name in square brackets, without a table name:

Lower of profit or sales = MIN([Total profit], [Total sales])

Higher of profit or sales = MAX([Total profit], [Total sales])
Power BI MIN comparing the Total profit and Total sales measures

A common mistake, and one that was in an older version of this post, is writing MAX(Sheet[Total profit], Sheet[Total sales]). Measures aren’t columns, so DAX rejects it.

If you want the gap between the two measures instead, subtract one measure from another.

How blanks behave

When you compare two expressions, a blank is treated as 0. That gives some results that surprise people:

FormulaResult
MAX(1, BLANK())1
MAX(-1, BLANK())0
MIN(1, BLANK())0
MIN(-1, BLANK())-1
MIN(BLANK(), BLANK())Blank

So if one measure can be blank, for example a product with no sales this month, MIN([Total profit], [Total sales]) returns 0 rather than the other value. Wrap the measure in IF(ISBLANK(...)) if that matters to you.

See the Power BI measure IF examples for more ways to handle blanks.

MINA and MAXA

MINA and MAXA take only a column. The difference from MIN and MAX is that they also read logical values: TRUE counts as 1 and FALSE as 0. Empty cells are ignored, and if there’s nothing to read, they return 0.

Lowest sales (MINA) = MINA(Sheet[Sales])
Power BI MINA measure on the Sales column
Highest sales (MAXA) = MAXA(Sheet[Sales])
Power BI MAXA measure on the Sales column

On a number or date column, they give the same result as MIN and MAX. They’re useful on a TRUE/FALSE column. My logical table has a Boolean column:

Any false (MINA) = MINA(logical[Boolean])

Any true (MAXA) = MAXA(logical[Boolean])
Power BI MINA on a Boolean column returning 0
Power BI MAXA on a Boolean column returning 1

MINA returns 0 when at least one value is FALSE, and MAXA returns 1 when at least one is TRUE. Two things to know: on a text column, MINA and MAXA return 0, so use MIN and MAX for text, and they aren’t supported in calculated columns or row-level security rules in DirectQuery mode.

The A versions work like COUNTA in the DAX count functions: they read more data types than the plain version.

MINX and MAXX

MINX and MAXX are iterators. They go through a table row by row, calculate an expression for each row, and then return the smallest or largest result. That’s why they’re the right choice when the value you want doesn’t exist in a single column.

Lowest sales (MINX) = MINX(Sheet, Sheet[Sales])
Power BI MINX measure returning the lowest sales
Highest sales (MAXX) = MAXX(Sheet, Sheet[Sales])
Power BI MAXX measure returning the highest sales

With a simple column, they return the same as MIN and MAX. MAXX also works on text, and in my test MINX returned the first product name too:

First product (MINX) = MINX(Sheet, Sheet[Product])

Last product (MAXX) = MAXX(Sheet, Sheet[Product])
Power BI MINX on the Product text column
Power BI MAXX on the Product text column

MAXX with a filter

This is where MAXX earns its place. To get the highest sale for product AAA only, pass a filtered table as the first argument:

Highest AAA sale = MAXX(FILTER(Sheet, Sheet[Product] = "AAA"), Sheet[Sales])
Power BI MAXX with FILTER returning the highest sale for product AAA

The result is 80. You can also calculate in the expression, for example the largest profit margin of any order:

For other ways to filter a measure, see Power BI measure filter examples, and for safe division, see how to divide in a Power BI measure.

Best margin = MAXX(Sheet, DIVIDE(Sheet[Profit], Sheet[Sales]))

The optional variant argument

MAXX and MINX have a third, optional argument. When the expression returns mixed types, such as numbers and text, they only look at the numbers by default. Set the third argument to TRUE to compare all of them, in the same order a descending sort would use. Most reports never need it.

Real-world examples

Example 1: Highest and lowest test score

My second table, Sheet 1, has students and their test scores:

Sample table with student names and test scores
Highest score = MAX('Sheet 1'[Test score])

Lowest score = MIN('Sheet 1'[Test score])
Power BI card showing the highest test score
Power BI card showing the lowest test score

Example 2: Minimum transit days for one plant

This table has a plant name, a region and the transit days for each delivery:

Sample table with plant, region and transit days

To get the shortest transit time for plant A, filter the table inside MINX:

Min transit days plant A = MINX(FILTER('Table', 'Table'[Plant] = "A"), 'Table'[Transit days])
Power BI MINX returning the minimum transit days for plant A

If you put Plant on the rows of a table visual, you don’t need the filter at all: MIN('Table'[Transit days]) shows the minimum for each plant automatically.

Example 3: The max across several columns

This table has three value columns, Col1, Col2 and Col3, and I want the single highest value across all of them:

Sample table with three value columns

Build a small table of the three maximums with curly braces, then take the largest with MAXX:

Max of three columns =
MAXX(
    {
        MAX('Table (2)'[Col1]),
        MAX('Table (2)'[Col2]),
        MAX('Table (2)'[Col3])
    },
    [Value]
)
Power BI MAXX returning the highest value across three columns

The curly braces create a one-column table, and its column is always named [Value].

Example 4: The max value per category

This table has a category column and a value column:

Sample table with category and value columns

To show the category’s highest value on every row, even when the visual has more detail, keep only the category filter with ALLEXCEPT:

Max per category = CALCULATE(MAX(Table3[Value]), ALLEXCEPT(Table3, Table3[Column]))
Power BI measure returning the max value for each category

The same pattern gives you the latest date per category, for example the last order date for each product: CALCULATE(MAX(Sheet[Order date]), ALLEXCEPT(Sheet, Sheet[Product])). For more category patterns, see Power BI measures by category.

Example 5: Sales on the latest date

To show the sales from the most recent order date, store the date in a variable and filter on it:

Sales on latest date =
VAR LatestDate = MAX(Sheet[Order date])
RETURN
    CALCULATE(SUM(Sheet[Sales]), Sheet[Order date] = LatestDate)

With the sample data, that’s 60, the CCC order on 12/04/2026. The same idea works with MIN for the first date, for example an inventory table where the first selected day has no data:

Inventory on first date =
VAR FirstSelected = MIN('Date'[Date])
VAR FirstWithData =
    CALCULATE(MIN(Inventory[Date]), Inventory[Date] >= FirstSelected)
RETURN
    CALCULATE(SUM(Inventory[Average inventory]), Inventory[Date] = FirstWithData)

Here, the Date table is created with Date = CALENDAR(DATE(2026, 10, 1), DATE(2026, 10, 31)) and related to the Inventory table. See how to create a date table in Power BI.

Measure, calculated column or visual calculation?

  • Measure: my default. It’s calculated for whatever is filtered on the report, so the max changes when you use a slicer.
  • Calculated column: calculated once per row when the data refreshes, and stored in the model. Use it only when you need the value on each row, for example to sort or filter by it. To get the max of a group in a calculated column, use the ALLEXCEPT pattern above.
  • Visual calculation: DAX that lives on one visual and works on the data already in it. Select the visual and choose New calculation. It’s often faster than a measure, but it can only use what’s on the visual.

Common mistakes

  • Writing a measure as if it were a column, like Sheet[Total sales]. Refer to measures by name only: MAX([Total sales], [Total profit]).
  • Expecting MAXA or MINA to compare text. They return 0 for text columns.
  • Forgetting that a blank counts as 0 in the two-value form of MIN and MAX.
  • Using MAX on a TRUE/FALSE column. It isn’t supported, so use MAXA.

These Power BI DAX tutorials go well with this one:

Frequently Asked Questions

What’s the difference between MAX and MAXX in Power BI?

MAX returns the largest value in one column. MAXX calculates an expression for each row of a table and returns the largest result, so you can filter rows or combine columns. See Microsoft’s MAXX function reference.

How do I get the max value per category in Power BI?

Put the category in a visual and use MAX, or create a measure with CALCULATE(MAX(Table[Value]), ALLEXCEPT(Table, Table[Category])) to repeat the category max on every row.

Does MIN in DAX ignore blanks?

On a column, yes. But in the two-value form, a blank is treated as 0, so MIN(1, BLANK()) returns 0.

Can MAX return a date or text in Power BI?

Yes. MAX and MIN work on dates and text. For text, they compare alphabetically.