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
| Function | Syntax | Use it when |
|---|---|---|
| MAX | MAX(<column>) or MAX(<expr1>, <expr2>) | You want the largest number, date or text in a column, or the larger of two values |
| MIN | MIN(<column>) or MIN(<expr1>, <expr2>) | You want the smallest value, or the smaller of two values |
| MAXA | MAXA(<column>) | The column has logical values (TRUE counts as 1, FALSE as 0) |
| MINA | MINA(<column>) | Same as MAXA, for the smallest value |
| MAXX | MAXX(<table>, <expression>[, <variant>]) | You calculate a value per row, or filter the table, before taking the largest |
| MINX | MINX(<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:
| Product | Sales | Order date | Profit |
|---|---|---|---|
| AAA | 20 | 02/02/2026 | 5 |
| BBB | 30 | 12/02/2026 | 10 |
| CCC | 60 | 02/28/2026 | 20 |
| DDD | 80 | 06/03/2026 | 20 |
| EEE | 100 | 08/03/2026 | 40 |
| FFF | 120 | 03/18/2026 | 60 |
| CCC | 60 | 12/04/2026 | 10 |
| BBB | 30 | 04/14/2026 | 11 |
| AAA | 80 | 05/18/2026 | 9 |
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])

Highest sales = MAX(Sheet[Sales])

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])

Last product = MAX(Sheet[Product])

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])

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:
| Formula | Result |
|---|---|
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])

Highest sales (MAXA) = MAXA(Sheet[Sales])

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])


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])

Highest sales (MAXX) = MAXX(Sheet, Sheet[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])


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])

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:

Highest score = MAX('Sheet 1'[Test score])
Lowest score = MIN('Sheet 1'[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:

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])

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:

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]
)

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:

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]))

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.

I have worked with Microsoft technologies for more than 18 years, including SharePoint, Microsoft 365 and the Power Platform (Power Apps, Power Automate and Power BI), at companies like HP, TCS and KPIT. I started EnjoySharePoint in 2011 to share the solutions I build in real projects with readers in the United States, Canada, the United Kingdom, Australia, New Zealand and beyond. Microsoft has recognized this work with the Microsoft MVP award 13 times since 2014.