## How does the MAXX function (DAX) work?

The MAXX function (DAX) evaluates an expression for each table row, and returns the largest value.

## MAXX Formula Syntax

MAXX(
<table>,<expression>
)

## How do you use the MAXX function?

The table statement for the MAXX function may be the name of a table, or the expression evaluating a table. The second argument determines the expression to be evaluated for each table row.

## Related Support Forum Posts

How to add filter in the MAXX function?
Iterating Functions Deep Dive – SUMX, AVERAGEX, MINX, MAXX
Dynamic Row Level Security w/ Multiple Criteria

## Considerations when using the MAXX function

Only the following are listed as to the values to be evaluated:

• Numbers
• Texts
• Dates

Blank values are ignored. TRUE/FALSE values are not supported.

## Formula examples using the MAXX function

### Example 1

The following formula uses an expression as the second argument to calculate the total amount of taxes and shipping for each order in the table, InternetSales. The expected result is 375.7184.

= MAXX (
InternetSales, InternetSales[TaxAmt]+ InternetSales[Freight]
)

### Example 2

The following formula first filters the table InternetSales, by using a FILTER expression, to return a subset of orders for a specific sales region, defined as [SalesTerritory] = 5. The MAXX function then evaluates the expression used as the second argument for each row of the filtered table, and returns the highest amount for taxes and shipping for just those orders. The expected result is 250.3724.

=MAXX (
InternetSales,[SalesTerritoryCode]=”5″), InternetSales[TaxAmt]+ InternetSales[Freight]
)

### Example 3

=MAXX (
(East_Sales,East_Sales[No. of Units]*East_Sales[Unit Price]
)

## Related Course Modules 