How to do it...

To complete this recipe, do the following:

  1. Create the following measure:
InCommon = 
VAR __Students1 =
SELECTCOLUMNS(
FILTER(
ALL('R02_Students'),
'R02_Students'[Teacher] = MAX('R02_Teachers1'[Teacher])
),
"__Student",'R02_Students'[Student]
)
VAR __Students2 =
SELECTCOLUMNS(
FILTER(
ALL('R02_Students'),
'R02_Students'[Teacher] = MAX('R02_Teachers2'[Teacher])
),
"__Student",'R02_Students'[Student]
)
VAR __InCommon = COUNTROWS(INTERSECT(__Students1,__Students2))
RETURN
IF(ISBLANK(__InCommon),0,__InCommon)
  1. On a Report page, create a Matrix visualization and place the Teacher column from the R02_Teachers1 table into the Rows area.
  2. In the same Matrix visualization, place the Teacher column from the R02_Teachers2 table into the Columns area.
  3. In the same Matrix visualization, place the InCommon measure into the Values area.