AVERAGEX DAX Function in Power BI
The AVERAGEX DAX function evaluates an expression row by row over a table and returns the average (arithmetic mean) of those values.
DAX Syntax AVERAGEX(table, expression)
The function has the following parameters:
- table: It specifies the name of a table, or an expression over which the aggregation can be performed.
- expression: An expression with a scalar result, which will be evaluated for each row of the table in the first argument.
Example: Basic AVERAGEX with a calculated value.
DAX
AVERAGEX Measure = AVERAGEX( MarksTable, -- Table to iterate over MarksTable[Marks] -- Expression to evaluate and average )
This is like AVERAGE(MarksTable[Marks]). The output of the above code is shown below:
