DAX Other - INTERSECT function



Description

Returns the row intersection of two tables, retaining the duplicates.

DAX INTERSECT function is new in Excel 2016.

Syntax

INTERSECT (<table_expression1>, <table_expression2>) 

Parameters

Term Description
table_expression1 Any DAX expression that returns a table.
table_expression2

Return Value

A table that contains all the rows in table_expression1 that are also in table_expression2.

Remarks

  • Intersect is not commutative. That means, Intersect (T1, T2) can have a different result set than Intersect (T2, T1).

  • Duplicate rows are retained. That means, if a row appears in table_expression1 and table_expression2, it and all duplicates in table_expression_1 are included in the result set.

  • The column names will match the column names in table_expression1.

  • Columns are compared based on the positioning, and data comparison with no type coercion.

  • The returned table does not include columns from the tables related to table_expression1.

Example

= SUMX (INTERSECT (SalesOldData,SalesNewData),[Sales Amount]) 

This DAX formula returns the sum of Sales Amount for all the rows that are present in the table SalesOldData, which are also present in the SalesNewData.

dax_functions_other.htm
Advertisements