CROSSJOIN

The CROSSJOIN function returns a table made up of the Cartesian product of all the rows in all the tables included as arguments.

Syntax

CROSSJOIN(
    table,
    table
    [, table...]
)

Parameters
  • table: Reference to an existing table or DAX expression that returns a table.
Returned value

The CROSSJOIN function returns a table.

Additional Information

The columns of the result table are all the columns present in the tables included as arguments.

The column names must all be different or the function will return an error.

The number of rows contained in the result table will be equal to the product of the number of rows in all the tables.

Examples

If we start from the following tables, Table1:

CROSSJOIN function. Example of use

Table2:

CROSSJOIN function. Example of use

and Table3:

CROSSJOIN function. Example of use

We can create a table with the Cartesian product of the rows of Table1 and Table2 with the following DAX expression:

crossjoin = CROSSJOIN(Table1, Table2)

CROSSJOIN function. Example of use

The number of rows in the resulting table (6) matches the product of the number of rows in Table1 (3) and the number of rows in Table2 (2).

To create a table with the Cartesian product of the rows of the three previous tables we would have to use the following DAX expression:

crossjoin = CROSSJOIN(Table1, Table2, Table3)

CROSSJOIN function. Example of use
Category
Statistical
Submitted by admin on Thu, 01/17/2019 - 13:57