Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
Calculated column
Calculated table
Measure
Visual calculation
Returns the row intersection of two tables, retaining duplicates.
INTERSECT(<table_expression1>, <table_expression2>)
Term | Definition |
---|---|
Table_expression |
Any DAX expression that returns a table. |
A table that contains all the rows in table_expression1 that are also in table_expression2
Intersect is not commutative. In general, Intersect(T1, T2) will have a different result set than Intersect(T2, T1).
Duplicate rows are retained. 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.
The returned table has lineage based on the columns in table_expression1 , regardless of the lineage of the columns in the second table. For example, if the first column of first table_expression has lineage to the base column C1 in the model, the intersect will reduce the rows based on the intersect on first column of second table_expression and keep the lineage on base column C1 intact.
Columns are compared based on positioning, and data comparison with no type coercion.
The returned table does not include columns from tables related to table_expression1.
This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
States1
State |
---|
A |
A |
B |
B |
B |
C |
D |
D |
States2
State |
---|
B |
C |
D |
D |
D |
E |
Intersect(States1, States2)
State |
---|
B |
B |
B |
C |
D |
D |
Intersect(States2, States1)
State |
---|
B |
C |
D |
D |
D |
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today