Forum Discussion
Calculating overlap between calculated columns
Familiarize yourself with the concept of INTERSECT()
INTERSECT function (DAX) - DAX | Microsoft Docs
Create temporary single column tables from your selected columns, and then use Intersect to compare them.
Hello,
Thank you for your reply.
It looks like I need to create an INTERESECT for every combination of [SP] I want to compare though.
Is it possible to use this like a measure so it shows overlap based on slicer selection of [SP]?
Thank you
- lbendlin4 years agoSuper User
Yes, that was what I suggested. Just be aware that at the end the measure needs to return a scalar value.
- qmartiny4 years agoHelper III
I am trying something like this first to isolate the SPx columns.
"Create temporary single column tables from your selected columns" - I suppose you mean a UNION like below.UNION(
SELECTCOLUMNS(_MAL,"BP",_MAL[BP_ID],"SP",_MAL[SP1]),
SELECTCOLUMNS(_MAL,"BP",_MAL[BP_ID],"SP",_MAL[SP2]),
SELECTCOLUMNS(_MAL,"BP",_MAL[BP_ID],"SP",_MAL[SP3]))I understand INTERCEPT takes 2 tables max, and I could use FIRSTNONBLANK / LASTNONBLANK? to feed slicer selection ?
Do you have any pointers ? Thank you
- lbendlin4 years agoSuper User
Not UNION but INTERSECT. something like this:
VAR A = SELECTCOLUMNS(_MAL,"BP",_MAL[BP_ID],"SP",_MAL[SP1]) VAR B = SELECTCOLUMNS(_MAL,"BP",_MAL[BP_ID],"SP",_MAL[SP2]) RETURN COUNTROWS(INTERSECT(A,B))