PRODUCT vs PRODUCTX in DAX: Handling Blank Values with COALESCE

September 28, 2026 85 visits

In this article, we will learn how to calculate the product of values using
PRODUCT and PRODUCTX in DAX. We will also see
how COALESCE can be used with PRODUCTX to replace
blank values with a default value before multiplication.

📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist

What Is the PRODUCT Function in DAX?

PRODUCT returns the product of all the numbers in a column.
In simple terms, it multiplies the numeric values together.

The basic syntax is:

DAX Syntax
PRODUCT(<Column>)

PRODUCT works directly on a column. It does not allow us to
write a custom expression for every row.

What Is the PRODUCTX Function?

PRODUCTX is the iterator version of PRODUCT.
It evaluates an expression for every row of a table and then multiplies the
resulting values together.

The basic syntax is:

DAX Syntax
PRODUCTX(
    <Table>,
    <Expression>
)

This makes PRODUCTX more flexible because the second argument
can contain a DAX expression rather than only a physical column reference.


1. View the AvgTable

Query

DAX Query
EVALUATE
    AvgTable

Step-by-step explanation

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

Step 2: AvgTable
AvgTable is the table being returned by the query.

This query is useful for inspecting the values in Col C
before calculating the product.

What should you look for?

Pay particular attention to Col C. If the column contains
blank values, those blanks become important when comparing the two calculations
later in the query.

Key takeaway:
Always inspect the source column when learning an aggregation or iterator,
especially when blank values may be present.

2. Calculate the Product Using PRODUCT

Query

DAX Query
PRODUCT(AvgTable[Col C])

Step-by-step explanation

Step 1: AvgTable[Col C]
The expression passes the Col C column from
AvgTable to the PRODUCT function.

Step 2: PRODUCT
PRODUCT multiplies the values in the specified column
to produce a single numeric result.

For example, if the relevant values were 2, 3, and 4,
the product would be:

Calculation
2 × 3 × 4 = 24

The important point is that PRODUCT works directly with
the column. You cannot replace the column argument with a row-by-row
custom expression in this function.

Key takeaway:
PRODUCT is useful when you simply need the product of
the values in an existing column.

3. Calculate the Product Using PRODUCTX and COALESCE

Query

DAX Query
PRODUCTX(
    AvgTable,
    COALESCE([Col C], 5)
)

Step-by-step explanation

Step 1: AvgTable
This is the table over which PRODUCTX iterates.

Step 2: PRODUCTX
PRODUCTX evaluates the expression for every row of
AvgTable and then multiplies the resulting values.

Step 3: [Col C]
[Col C] refers to the value from the current row of
AvgTable.

Step 4: COALESCE([Col C], 5)
COALESCE returns the value of [Col C]
when it is not blank. If [Col C] is blank, it returns
5 instead.

COALESCE Logic
COALESCE([Col C], 5)

If [Col C] has a value → use [Col C]
If [Col C] is BLANK → use 5

Therefore, PRODUCTX is not simply multiplying the original
column values. It is multiplying the values returned by the expression
COALESCE([Col C], 5) for each row.

Key takeaway:
PRODUCTX allows you to transform each row’s value before
including it in the product calculation.

4. Compare PRODUCT and PRODUCTX

Complete Query

DAX Query
EVALUATE
    AvgTable

EVALUATE
    ROW(
        "Product", PRODUCT(AvgTable[Col C]),
        "Product Expression", PRODUCTX(AvgTable, COALESCE([Col C], 5))
    )

Step-by-step explanation

Step 1: EVALUATE AvgTable
The first query displays the source table so that we can inspect
Col C.

Step 2: ROW
The second EVALUATE returns a single-row table containing
two calculated values.

Step 3: “Product”
This output column contains the result of
PRODUCT(AvgTable[Col C]).

Step 4: “Product Expression”
This output column contains the result of
PRODUCTX(AvgTable, COALESCE([Col C], 5)).

The two calculations use the same source table, but they do not perform
exactly the same operation.

Calculation How It Works
PRODUCT(AvgTable[Col C]) Calculates the product directly from the column.
PRODUCTX(AvgTable, COALESCE([Col C], 5)) Evaluates COALESCE for each row and then multiplies the resulting values.

5. Why Does COALESCE Change the Result?

The key difference appears when Col C contains blank values.
With PRODUCTX, the expression explicitly converts a blank
[Col C] value into 5.

For example, consider a simplified set of values:

Row Col C COALESCE([Col C], 5)
1 2 2
2 3 3
3 Blank 5

The expression changes the blank value to 5 before
PRODUCTX performs the multiplication.

In this example, the values used by PRODUCTX become:

Values Evaluated by PRODUCTX
2 × 3 × 5 = 30

The exact result of your query depends on the actual values present in
AvgTable[Col C].

Important:
The purpose of COALESCE here is to explicitly define what
should be used when [Col C] is blank. It does not simply
calculate the product of the original column unchanged.

6. Understanding PRODUCT vs PRODUCTX

Feature PRODUCT PRODUCTX
Input Column Table + Expression
Row-by-row expression No Yes
Can use COALESCE per row No Yes
Returns Single product value Single product value

Important Notes

1. PRODUCT works directly on a column

Use PRODUCT when the calculation only requires the values
from an existing column.

2. PRODUCTX evaluates an expression

PRODUCTX is useful when the value to be multiplied must
be calculated or transformed for each row.

3. COALESCE provides a fallback value

In this query, COALESCE([Col C], 5) means that a blank
value is replaced with 5 before the multiplication.

4. PRODUCTX is an iterator

The X functions in DAX, such as SUMX,
AVERAGEX, and PRODUCTX, evaluate an
expression row by row over a table.

📝 Practice Exercise

Modify the PRODUCTX expression so that blank values in
Col C are replaced with 1 instead of
5.

Then compare the result with the original PRODUCT calculation.

Try this query

DAX Query
EVALUATE
    ROW(
        "Product", PRODUCT(AvgTable[Col C]),
        "Product Expression", PRODUCTX(AvgTable, COALESCE([Col C], 1))
    )

Observe how changing the fallback value in COALESCE
affects the product.

Conclusion

In this article, we learned how PRODUCT and
PRODUCTX calculate the product of values in DAX.

  • PRODUCT calculates the product directly from a column.
  • PRODUCTX evaluates an expression for each row before multiplying the results.
  • COALESCE can be used to replace blank values with a specified fallback value.
  • PRODUCTX provides more flexibility because it works with a table and row-level expression.

The important concept is that PRODUCTX does not have to
use the original column value directly. By combining it with functions
such as COALESCE, you can control how each row contributes
to the final product.

Next: Continue exploring DAX aggregation and iterator
functions to understand when a direct aggregation and a row-by-row
expression produce different results.


📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist