# CROSSJOIN Function (DAX)

Owen Duncan|Last Updated: 4/19/2018

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

## Syntax

``````CROSSJOIN(<table>, <table>[, <table>]…)
``````

#### Parameters

table
Any DAX expression that returns a table of data

## Return Value

A table that contains the Cartesian product of all rows from all tables in the arguments.

## Remarks

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

• The total number of rows returned by CROSSJOIN() is equal to the product of the number of rows from all tables in the arguments; also, the total number of columns in the result table is the sum of the number of columns in all tables. For example, if TableA has rA rows and cA columns, and TableB has rB rows and cB columns, and TableC has rC rows and cC column; then, the resulting table has rA × rb × rC rows and cA + cB + cC columns.

## Example

The following example shows the results of applying CROSSJOIN() to two tables: Colors and Stationery.

The table Colors contains colors and patterns:

ColorPattern
RedHorizontal Stripe
GreenVertical Stripe
BlueCrosshatch

The table Stationery contains fonts and presentation:

FontPresentation
serifembossed
sans-serifengraved

The expression to generate the cross join is presented below:

``````CROSSJOIN( Colors, Stationery)
``````

When the above expression is used wherever a table expression is expected, the results of the expression would be as follows:

ColorPatternFontPresentation
RedHorizontal Stripeserifembossed
GreenVertical Stripeserifembossed
BlueCrosshatchserifembossed
RedHorizontal Stripesans-serifengraved
GreenVertical Stripesans-serifengraved
BlueCrosshatchsans-serifengraved