AVERAGEX

Updated on

AVERAGEX is a DAX function that calculates the average (arithmetic mean) of a set of expressions evaluated over a table.

Syntax

AVERAGEX(
   Table,
   Expression
)
Argument Properties Description
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 Values

A decimal number.

Remarks

  • The AVERAGEX function enables you to evaluate expressions for each row of a table, and then take the resulting set of values and calculate its arithmetic mean. Therefore, the function takes a table as its first argument, and an expression as the second argument.

  • In all other respects, AVERAGEX follows the same rules as AVERAGE. You cannot include non-numeric or null cells. Both the table and expression arguments are required.

  • When there are no rows to aggregate, the function returns a blank. When there are rows, but none of them meet the specified criteria, then the function returns 0.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

The following example calculates the average freight and tax on each order in the InternetSales table, by first summing Freight plus TaxAmt in each row, and then averaging those sums.

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

If you use multiple operations in the expression used as the second argument, you must use parentheses to control the order of calculations. For more information, see DAX Syntax Reference.

Other functions related to AVERAGEX are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/averagex-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy