Understanding AVERAGE, AVERAGEX and AVERAGEA in DAX

September 28, 2026 129 visits

In this article, we will learn the difference between AVERAGE,
AVERAGEX, and AVERAGEA in DAX. Although all three
functions are related to calculating averages, they work differently and are useful
in different analytical scenarios.

📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist

What Are Average Operations in DAX?

An average represents the arithmetic mean of a set of values.
DAX provides multiple functions for calculating averages because the calculation
can be performed directly on a column or by evaluating an expression row by row.

In this example, the CountTable table contains three columns:
Column A, Column B, and Column C.
We will use the same table to understand how the three functions behave.

1. Displaying the CountTable

Query

DAX Query
EVALUATE
    CountTable

Step-by-step explanation

Step 1: EVALUATE
EVALUATE tells DAX to return a table expression as the query result.

Step 2: CountTable
CountTable is the table expression. DAX returns the rows and columns
available in this table.

Why do we display the table first?

Looking at the source data helps us understand what values each average function
will process. This becomes especially important when the data contains
blank values or text values.

Key takeaway:
Always understand the source data before comparing aggregation functions.
The treatment of blanks, text, and expressions can change the result.

2. Using AVERAGE

Query

DAX Query
EVALUATE
    ROW(
        "Average", AVERAGE(CountTable[Column A]),
        "Average X", AVERAGEX(CountTable, COALESCE([Column B], 0)),
        "Average A", AVERAGEA(CountTable[Column C])
    )

The first calculation in the ROW function is:

AVERAGE
AVERAGE(CountTable[Column A])

Step-by-step explanation

Step 1: CountTable[Column A]
We provide the Column A column as the input to the
AVERAGE function.

Step 2: AVERAGE
AVERAGE calculates the arithmetic mean of the numeric values
in the specified column.

Conceptually, the calculation is the total of the values divided by the number
of values considered in the average.

Key takeaway:
Use AVERAGE when you want to calculate the average directly
from a numeric column.

3. Using AVERAGEX

The second calculation uses AVERAGEX:

AVERAGEX
AVERAGEX(CountTable, COALESCE([Column B], 0))

Step-by-step explanation

Step 1: CountTable
The first argument is CountTable. This tells DAX which table
should be iterated.

Step 2: Row-by-row evaluation
AVERAGEX evaluates the expression for each row of the supplied table.
This is the important difference between AVERAGE and
AVERAGEX.

Step 3: COALESCE([Column B], 0)
For every row, DAX evaluates [Column B]. If the value is blank,
COALESCE replaces that blank with 0.

Therefore, the expression being averaged is not simply the original
Column B values. It is the row-by-row result of:

Expression
COALESCE([Column B], 0)

Key takeaway:
AVERAGEX is an iterator. It evaluates an expression for each row
and then calculates the average of those resulting values.

Why use AVERAGEX instead of AVERAGE?

AVERAGEX becomes useful when the value to be averaged is not simply
an existing column, but must first be calculated.

For example, you could calculate an average of a row-level expression such as:

Row-level Expression
AVERAGEX(
    Sales,
    Sales[Sales Amount] - Sales[Total Product Cost]
)

Here, DAX calculates the expression for each row and then averages those results.

4. Using AVERAGEA

The third calculation uses AVERAGEA:

AVERAGEA
AVERAGEA(CountTable[Column C])

Step-by-step explanation

Step 1: CountTable[Column C]
We provide Column C as the input column.

Step 2: AVERAGEA
AVERAGEA is designed to calculate an average while applying
special handling to logical and text values.

This makes AVERAGEA different from the regular
AVERAGE function. When working with mixed data types, it is
important to understand how those values are treated before using this function.

Key takeaway:
AVERAGEA is useful when the column can contain values other than
ordinary numeric values and you specifically want its A-style treatment of
logical and text data.

5. Understanding the Complete ROW Query

Now let’s look at the complete query:

Complete DAX Query
EVALUATE
    ROW(
        "Average", AVERAGE(CountTable[Column A]),
        "Average X", AVERAGEX(CountTable, COALESCE([Column B], 0)),
        "Average A", AVERAGEA(CountTable[Column C])
    )

Step-by-step explanation

Step 1: EVALUATE
The query begins with EVALUATE, which returns the table expression
produced by ROW.

Step 2: ROW
ROW creates a single-row table containing the calculated values.

Step 3: “Average”
This is the output column name for the result of
AVERAGE(CountTable[Column A]).

Step 4: “Average X”
This is the output column name for the result of
AVERAGEX(CountTable, COALESCE([Column B], 0)).

Step 5: “Average A”
This is the output column name for the result of
AVERAGEA(CountTable[Column C]).

What will you get?

Average Average X Average A
Average of Column A Average of row-by-row Column B expression Average of Column C using A-style handling

The exact numerical results depend on the values stored in your
CountTable.

6. AVERAGE vs AVERAGEX vs AVERAGEA

Function How it works Typical use
AVERAGE Calculates the average directly from a column. Average of an existing numeric column.
AVERAGEX Iterates through a table and evaluates an expression for each row. Average of a calculated row-level expression.
AVERAGEA Calculates an average with A-style handling of logical and text values. Columns containing mixed value types where this behavior is required.

7. The Most Important Difference: Column vs Expression

One of the easiest ways to remember the difference is to focus on what you are
averaging.

Requirement Function to consider
You already have a numeric column. AVERAGE
You need to calculate a value for every row before averaging. AVERAGEX
You specifically need A-style treatment of logical or text values. AVERAGEA
Key takeaway:
The X in AVERAGEX is a useful reminder that
the function is an iterator. It evaluates an expression row by row before
calculating the average.

8. Understanding COALESCE in the AVERAGEX Example

Our query uses:

COALESCE
COALESCE([Column B], 0)

COALESCE returns the first value that is not blank. In this example,
if [Column B] contains a value, that value is returned. If it is
blank, 0 is returned.

This means the AVERAGEX calculation explicitly treats blank
values as zero in the expression being averaged.

Important:
Replacing a blank with zero can change the average. Therefore, using
COALESCE should be an intentional business decision rather than
something added automatically.

📝 Practice Exercise

Using the CountTable, try creating three separate DAX queries:

  1. Calculate the average of Column A using AVERAGE.
  2. Calculate the average of Column B using AVERAGEX.
  3. Calculate the average of Column C using AVERAGEA.

Then modify the AVERAGEX expression so that blank values in
Column B are replaced with zero using COALESCE.

Practice Query

DAX Query
EVALUATE
    ROW(
        "Average", AVERAGE(CountTable[Column A]),
        "Average X", AVERAGEX(CountTable, COALESCE([Column B], 0)),
        "Average A", AVERAGEA(CountTable[Column C])
    )

Conclusion

In this article, we learned how three DAX average functions work and when their
behavior differs.

  • AVERAGE calculates the average directly from a column.
  • AVERAGEX iterates through a table, evaluates an expression row by row, and averages the results.
  • COALESCE can be used inside AVERAGEX to explicitly replace blank values with zero.
  • AVERAGEA applies A-style handling to logical and text values when calculating the average.
  • The correct function depends on whether you are averaging an existing column, a calculated expression, or mixed-type data requiring A-style behavior.

Understanding the difference between regular aggregation functions and iterator
functions is an important foundation for writing more advanced DAX calculations.


📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist