Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Matrix visual showing intersects between lists / single column tables

This feels like it should be easy but I just can't get it.   I have a number of lists that are DAX calculated tables with a single column. For the sake of simplicity imagine they are like this: ...
  • Fowmy's avatar
    Fowmy
    2 years ago

    Anonymous 

    Create the table to get the cross joins of the names and count the common colours for new column:

    Table 2 = 
    ADDCOLUMNS(
    	CROSSJOIN(
    		SELECTCOLUMNS( ALLNOBLANKROW('Table'[Name]), "Name1" , 'Table'[Name] ),
    		SELECTCOLUMNS( ALLNOBLANKROW('Table'[Name]), "Name2" , 'Table'[Name] )
    	),
    	"Common Colors" , 
    			VAR __T1 =  SELECTCOLUMNS( FILTER( ALL('Table') , 'Table'[Name] = [Name1] ) , 'Table'[Colour] )
    			VAR __T2 =  SELECTCOLUMNS( FILTER( ALL('Table') , 'Table'[Name] = [Name2] ) , 'Table'[Colour] )
    			VAR __RESULT = 
    				COUNTROWS( INTERSECT( __T1 , __T2 ))
    			RETURN
    				__RESULT
    )


    Create a simple measure and visualize in a matrix:

    Count of Common Colors = SUM( 'Table 2'[Common Colors] )


    File attached