5

MAXX

 3 years ago
source link: https://docs.microsoft.com/en-us/dax/maxx-function-dax
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
  • 07/08/2020
  • 2 minutes to read

In this article

Evaluates an expression for each row of a table and returns the largest value.

Syntax

MAXX(<table>,<expression>)  

Parameters

Parameters Term Definition 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.

Return value

The largest value.

Remarks

  • The table argument to the MAXX function can be a table name, or an expression that evaluates to a table. The second argument indicates the expression to be evaluated for each row of the table.

  • Of the values to evaluate, only the following are counted:

    • Numbers
    • Texts
    • Dates
  • Blank values are skipped. TRUE/FALSE values are not supported.

  • 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 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(FILTER(InternetSales,[SalesTerritoryCode]="5"), InternetSales[TaxAmt]+ InternetSales[Freight])  

See also

MAX function
MAXA function
Statistical functions

Is this page helpful?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK