Iterators
DAX AVERAGEX Function
Compute averages over entities rather than individual transactional rows.
Syntax Definition:
AVERAGEX( Table, Expression )
Overview
AVERAGEX iterates over a table, evaluates an expression for each row, and computes the arithmetic mean of the resulting values.
Architectural Deep Dive
AVERAGEX is crucial when calculating averages of higher-level entities, such as Average Revenue per Customer or Average Daily Orders. By passing a dimension table like Customers or Dates, each entity is evaluated individually before averaging.
Canonical Pattern Example:
Avg Customer Spend =
AVERAGEX(
Customers,
[Total Revenue]
)Common Anti-Patterns & Mistakes to Avoid
- •Confusing AVERAGE(Sales[Revenue]) with AVERAGEX(Customers, [Total Revenue])—they answer fundamentally different business questions.
- •Zeroes vs Blanks: AVERAGEX ignores rows that evaluate to BLANK(), but includes rows that return 0.
Interactive Challenge
Put DAX AVERAGEX Function into practice
Solve "Average Customer Revenue" in our interactive Monaco editor with live dataset verification.