AVERAGEX

The AVERAGEX function returns the arithmetic mean of the values returned by an expression that is evaluated for all rows in a table.

Syntax

AVERAGEX(
    <table>,
    <expression>
)

Parameters
  • table: Table containing the rows for which the expression will be evaluated.
  • expression: Expression to evaluate for each row of the table.
Returned value

The AVERAGEX function returns a real number.

Additional Information

The function evaluates the expression included as the second argument for each of the rows of the indicated table, returning the arithmetic mean of the values obtained. Only numeric values and dates are considered: the function does not accept non-numeric values or null cells. When there are no values to calculate the arithmetic mean for, the function returns a BLANK. When there are rows but none meet the appropriate criteria, the function returns 0.

The <table> argument can be either a table or a function that returns a table.

Examples

Suppose we have the following table showing the sales list, including the number of items sold and their unit price:

AVERAGEX function. Example of use

We can extract the average sale price of the sales made with the following measure:

Precio medio = AVERAGEX(Ventas,Ventas[Precio])

...obtaining the following result (taken to a "Card" type display):

AVERAGEX function. Example of use

If, in the previous scenario, we wanted to calculate the arithmetic mean of the value of the invoices issued (that is, the sale price considering the number of products sold), we could do so with the following measure:

Precio medio = AVERAGEX(Ventas,Ventas[Precio]*Ventas[Cantidad])

...obtaining the following result (taken to a "Card" type display):

AVERAGEX function. Example of use

Related functions
Category
Statistical
Submitted by admin on Mon, 12/03/2018 - 23:14