The AVERAGE DAX Function: Syntax, Real Examples, and When to Use AVERAGEX Instead

By Vivek Dhumal • 2026-09-25 • 9 min read
The AVERAGE DAX Function: Syntax, Real Examples, and When to Use AVERAGEX Instead

Key Takeaways

  • AVERAGE returns the arithmetic mean of a numeric column and automatically ignores blank cells, but it does not ignore zeros — that distinction causes most of the reporting errors people run into.
  • AVERAGE only accepts a column reference, not an expression. The moment you need to average a calculation (like row-level revenue), you need AVERAGEX, not AVERAGE.
  • AVERAGE is filter-context aware: the same measure returns a different number depending on which rows a visual, slicer, or CALCULATE filter has exposed to it.
  • Averaging a column of already-calculated percentages (like a per-row discount rate) gives you a mathematically different — and usually wrong — answer than computing a true weighted average.
  • To force AVERAGE to ignore an active filter and return a fixed baseline (a company-wide average, for example), wrap it in CALCULATE with ALL.

Every data professional eventually hits this question when calculating aggregations in Power BI. AVERAGE is one of the foundational DAX functions, but understanding its exact mechanics — especially around filter context and blank vs zero evaluation — is what separates clean measures from silent report discrepancies.

What AVERAGE Actually Does

AVERAGE is a DAX aggregation function that divides the sum of a numeric column by the count of its non-blank rows, recalculating that result for whichever rows the current filter context exposes to it. It's one of the first DAX functions most people learn, and one of the first ones people misuse.

That last part — filter context — is the piece that trips people up. AVERAGE isn't a static calculation over an entire table. It's a calculation over whatever subset of rows the report has currently filtered down to, whether that filter comes from a slicer, a row in a matrix, a page filter, or a CALCULATE statement wrapped around it.

Here's the syntax:

AVERAGE(<column>)

The argument must be a column reference — AVERAGE(Sales[SalesAmount]), for instance — not a formula. If you try to feed it an expression like AVERAGE(Sales[Quantity] * Sales[UnitPrice]), DAX rejects it. That single restriction is the reason AVERAGEX exists, and it's covered in detail further down.

This post uses one consistent sample dataset for every example, so you can watch the same ten rows produce different results depending on what you ask of them.

The Sample Dataset

Every example below runs against this Sales table:

OrderID SalesRep Region Category Quantity UnitPrice Discount SalesAmount
1AnitaEastElectronics31200360
2RajWestFurniture145045405
3AnitaEastElectronics21200240
4MeeraSouthOffice Supplies108080
5RajWestFurniture245090810
6AnitaEastOffice Supplies58436
7MeeraSouthElectronics11200120
8RajWestOffice Supplies20816144
9MeeraSouthFurniture14500450
10AnitaEastFurniture14500450

SalesAmount is Quantity × UnitPrice − Discount. All ten rows are real, whole numbers — no rounding was applied anywhere in this post, and every result below was verified against this exact dataset before publishing.

Example 1: A Basic AVERAGE Measure

The simplest use case — the average order value across every row in the table:

Average Order Value = AVERAGE(Sales[SalesAmount])
A Basic AVERAGE Measure in Power BI
A Basic AVERAGE Measure Example

With no filters applied, this sums all ten SalesAmount values (3,095) and divides by the row count (10), returning 309.5. Drop this measure into a card visual with nothing else on the report page, and that's exactly what you'll see.

Example 2: AVERAGE Inside a Matrix (Filter Context in Action)

Put the same measure into a matrix visual with Region on rows, and DAX recalculates it once per region, using only the rows that belong to that region:

  • East: 271.5 (rows 1, 3, 6, 10 — four orders)
  • West: 453.0 (rows 2, 5, 8 — three orders)
  • South: 216.67 (rows 4, 7, 9 — three orders)

Nothing about the measure changed. What changed is the filter context the visual applies before AVERAGE ever runs. This is the behavior that makes a single DAX measure reusable across dozens of report layouts without rewriting it.

Example 3: AVERAGE Combined with CALCULATE and FILTER

To answer a specific question — "what's the average order value for Electronics, regardless of what the user has filtered on the page?" — wrap AVERAGE in CALCULATE:

Avg Electronics Order = 
CALCULATE(
    AVERAGE(Sales[SalesAmount]),
    Sales[Category] = "Electronics"
)
AVERAGE Combined with CALCULATE and FILTER in Power BI
AVERAGE Combined with CALCULATE and FILTER Example

Only three rows qualify (orders 1, 3, and 7), and their SalesAmount values — 360, 240, and 120 — average out to 240. CALCULATE here does two things: it overrides whatever region or category filter the report page already had active, and it adds a new filter of its own.

Example 4: Why AVERAGE Can't Replace AVERAGEX

Suppose you want the average discount rate per order — Discount divided by gross sale value, per row. AVERAGE can't do this directly, because there's no pre-built column for it and AVERAGE won't accept an expression. This is exactly the gap AVERAGEX fills:

Avg Discount Rate = 
AVERAGEX(
    Sales,
    DIVIDE(Sales[Discount], Sales[Quantity] * Sales[UnitPrice])
)
Why AVERAGE Can't Replace AVERAGEX in Power BI
Why AVERAGE Can't Replace AVERAGEX Example

AVERAGEX iterates row by row, calculates the discount rate for each one, then averages those ten results. Six of the ten rows have a 0% discount, and the other four sit at 10% each, so this returns 4%.

Compare that to the weighted answer — total discount (155) divided by total gross sales before discount (3,250) — which comes out to 4.77%. Both numbers are mathematically correct answers to different questions: AVERAGEX above gives equal weight to every order regardless of size, while the weighted version gives more influence to bigger orders.

Example 5: Forcing AVERAGE to Ignore the Active Filter

Sometimes you need a fixed baseline — a company-wide average that doesn't change no matter which region a user has clicked on, so you can compare each region against it. ALL strips the filter before AVERAGE runs:

Company Avg Order Value = 
CALCULATE(
    AVERAGE(Sales[SalesAmount]),
    ALL(Sales)
)
Forcing AVERAGE to Ignore the Active Filter in Power BI
Forcing AVERAGE to Ignore the Active Filter Example

Wherever this measure appears — nested inside a West-only row of a matrix, for instance — it still returns 309.5, the full-table average, because ALL(Sales) removes every filter on the table before AVERAGE evaluates. Pair this with the regional AVERAGE from Example 2 and you can build a "vs. company average" variance column without a second physical table.

Core Rules and Default Behavior

• AVERAGE ignores blanks, not zeros. If a row's SalesAmount is BLANK() — an order entered but not yet priced, say — that row is excluded from both the sum and the count. A row with a genuine value of 0 is included in the count and drags the average down. Add an eleventh order with a blank SalesAmount to this dataset and the measure from Example 1 still returns 309.5, because the denominator stays at 10, not 11.

• AVERAGE respects the current filter context by default, and only ignores it when you explicitly strip filters with ALL, ALLSELECTED, or REMOVEFILTERS inside a CALCULATE.

• AVERAGE requires a column, AVERAGEX requires a table and an expression. If what you're averaging exists as a stored column, use AVERAGE. If it has to be calculated per row first, use AVERAGEX.

• Text-formatted numbers are silently excluded. If a column that looks numeric is actually stored as text (common after a messy import), AVERAGE treats every value in it as non-numeric and the result comes back blank rather than throwing an error.

• No rows and zero rows aren't the same outcome. If there's nothing at all for AVERAGE to aggregate, it returns blank. If rows exist in the table but a filter condition eliminates every single one of them (a CALCULATE filter that matches no records, for example), AVERAGE returns 0, not blank.

• AVERAGE triggers a context transition when called inside a row context, such as inside AVERAGEX or a calculated column.

• AVERAGE isn't the same function as AVERAGEA. AVERAGEA extends the calculation to logical and text values, converting TRUE into a 1 and folding both FALSE entries and non-numeric text in as zeros.

In Practice

A regional sales manager wants a single card visual showing "Average Deal Size" that updates as she clicks through region slicers, plus a table beside it comparing each rep's average against the company-wide number.

The Average Deal Size card uses the plain measure from Example 1 — AVERAGE(Sales[SalesAmount]) — since it needs to react to whatever the slicer selects. The comparison table needs two columns: each rep's average (the same base measure, now sliced by SalesRep instead of Region) and the fixed company baseline from Example 5, which stays constant regardless of which rep row it sits next to. Subtracting one from the other in a third measure gives her a "vs. company avg" column that flags Raj (453.0, well above the 309.5 baseline) against Meera (216.67, well below it) without a single manual filter.

Common Mistakes

Averaging a percentage column instead of computing a weighted average

As shown in Example 4, averaging ten independent discount percentages treats a $36 order and an $810 order as equally important. If the real question is "what share of our total revenue did we give away in discounts," a weighted calculation — total discount over total gross — is the correct measure.

Assuming AVERAGE excludes zeros

It doesn't. Only true blanks are excluded. A common symptom: a KPI looks lower than expected after adding rows for orders with $0 SalesAmount (returns, comps, or free samples), because those rows are counted in the denominator.

Trying to average an expression directly

AVERAGE(Sales[Quantity] * Sales[UnitPrice]) fails to compile. The fix is always AVERAGEX with the table as the first argument and the expression as the second.

Forgetting that a visual's filters stack with CALCULATE's filters

A measure built with CALCULATE(AVERAGE(...), Sales[Category] = "Electronics") still respects the region filter from a slicer on the page. Getting a company-wide, filter-proof number requires ALL, as in Example 5.

Frequently Asked Questions

What does the AVERAGE function do in DAX?

It returns the arithmetic mean of a numeric column, using only the rows visible in the current filter context, and automatically excluding blank values from both the sum and the count.

What's the difference between AVERAGE and AVERAGEX?

AVERAGE takes a single column and can't evaluate a formula. AVERAGEX takes a table plus a row-level expression, calculates that expression for every row, then averages the results — needed whenever you're averaging something that isn't already a stored column.

Can I filter what AVERAGE calculates?

Yes, by wrapping it in CALCULATE with one or more filter arguments. The filter adds to, rather than replaces, any filters already active from slicers or visuals on the page.

Why is my AVERAGE measure showing a different number than expected?

Usually one of three causes: the column is stored as text rather than a number, a page-level slicer is silently narrowing the rows being averaged, or the underlying data contains zero-value rows that a manual calculation elsewhere excluded.

Does AVERAGE work on a calculated column the same way it works on an imported column?

Yes — once a calculated column is materialized in the model, AVERAGE treats it identically to any imported column. The restriction against expressions only applies to inline formulas typed directly inside the AVERAGE() parentheses.

What's the difference between AVERAGE and AVERAGEA?

AVERAGE only aggregates numbers and ignores anything else. AVERAGEA also folds in logical and text values, treating TRUE as a 1 and both FALSE entries and any non-numeric text as zeros, which matters for columns like survey responses but rarely for standard financial or sales data.

Does AVERAGE return 0 or blank when there's nothing to calculate?

It depends on why there's nothing there. No rows in the table at all returns blank. Rows that exist but get filtered down to zero matches returns 0 — a distinction worth knowing before you build conditional formatting around either result.

Frequently Asked Questions

What does the AVERAGE function do in DAX?

It returns the arithmetic mean of a numeric column, using only the rows visible in the current filter context, and automatically excluding blank values from both the sum and the count.

What's the difference between AVERAGE and AVERAGEX?

AVERAGE takes a single column and can't evaluate a formula. AVERAGEX takes a table plus a row-level expression, calculates that expression for every row, then averages the results — needed whenever you're averaging something that isn't already a stored column.

Can I filter what AVERAGE calculates?

Yes, by wrapping it in CALCULATE with one or more filter arguments. The filter adds to, rather than replaces, any filters already active from slicers or visuals on the page.

Why is my AVERAGE measure showing a different number than expected?

Usually one of three causes: the column is stored as text rather than a number, a page-level slicer is silently narrowing the rows being averaged, or the underlying data contains zero-value rows that a manual calculation elsewhere excluded.

Does AVERAGE work on a calculated column the same way it works on an imported column?

Yes — once a calculated column is materialized in the model, AVERAGE treats it identically to any imported column. The restriction against expressions only applies to inline formulas typed directly inside the AVERAGE() parentheses.

What's the difference between AVERAGE and AVERAGEA?

AVERAGE only aggregates numbers and ignores anything else. AVERAGEA also folds in logical and text values, treating TRUE as a 1 and both FALSE entries and any non-numeric text as zeros, which matters for columns like survey responses but rarely for standard financial or sales data.

Does AVERAGE return 0 or blank when there's nothing to calculate?

It depends on why there's nothing there. No rows in the table at all returns blank. Rows that exist but get filtered down to zero matches returns 0 — a distinction worth knowing before you build conditional formatting around either result.

Vivek Dhumal

Vivek Dhumal

Microsoft Certified: PL-300, DP-600

Senior Power BI & Fabric Architect