DAX Aggregation - CROSSJOIN function



Description

Returns a table that contains the Cartesian product of all rows from all tables in the parameters. The columns in the new table are all the columns in all the parameter tables.

Syntax

CROSSJOIN (<table1>, <table2>, [<table3>] …) 

Parameters

Sr.No. Parameter & Description
1

table1

Table or a DAX expression that returns a table.

2

table2

Table or a DAX expression that returns a table.

3

table3

Optional.

Table or a DAX expression that returns a table.

Return Value

Returns a table that contains the Cartesian product of all rows from all tables in the parameters. The columns in the new table are all the columns in all the parameter tables.

Remarks

  • Column names from table parameters must all be different in all tables or an error is returned.

  • The total number of rows in the result table is the product of the number of rows from all tables in the parameters.

  • The total number of columns in the result table is the sum of the number of columns from all tables in the parameters.

For example, if table1 has r1 rows and c1 columns, table2 has r2 rows and c2 columns, and table3 has r3 rows and c3 columns, then the resulting table will have −

r1 × r2 × r3 rows and c1 + c2 + c3 columns

Example

= CROSSJOIN (Salesperson,Products) 
dax_functions_aggregation.htm
Advertisements