Forum Discussion
Anonymous
5 years agoNot applicable
Finding Common attributes between two different Datasets
I have two data sets Group A and Group B as shown below. GroupA Breakfast Lunch Dinner GroupB Breakfast Lunch Dinner A1 Cereal Pasta Vegetables B1 Cereal Pasta Veget...
- 5 years ago
Hey Anonymous ,
I created two tables Table A and Table B
I creatd 2 measures (looking for A in B), just create additional measures for the other way round.
These are my measures:
level of similarity = IF( HASONEVALUE( 'TableA'[GroupA] ) , IF( HASONEVALUE( 'TableB'[GroupB] ) , var searchstring = CONCATENATEX( 'TableA' , COMBINEVALUES( "|", 'TableA'[Breakfast] , 'TableA'[Lunch] , 'TableA'[Dinner] ) , "|" ) return SUMX( 'TableB' , var stringToCompare = COMBINEVALUES( "|", 'TableB'[Breakfast] , 'TableB'[Lunch] , 'TableB'[Dinner] ) var lengthSearch = PATHLENGTH( searchstring ) var t = ADDCOLUMNS( GENERATESERIES( 1 , lengthSearch , 1 ) , "isfound" , IF( PATHCONTAINS( stringToCompare , PATHITEM( searchstring , [Value] ) ) , 1 , 0 ) ) return SUMX( t , [isfound] ) ) , BLANK() ) , "Select one item from Group A" )and
similar items = IF( HASONEVALUE( 'TableA'[GroupA] ) , IF( HASONEVALUE( 'TableB'[GroupB] ) , var searchstring = CONCATENATEX( 'TableA' , COMBINEVALUES( "|", 'TableA'[Breakfast] , 'TableA'[Lunch] , 'TableA'[Dinner] ) , "|" ) return CONCATENATEX( 'TableB' , var stringToCompare = COMBINEVALUES( "|", 'TableB'[Breakfast] , 'TableB'[Lunch] , 'TableB'[Dinner] ) var lengthSearch = PATHLENGTH( searchstring ) var t = ADDCOLUMNS( GENERATESERIES( 1 , lengthSearch , 1 ) , "founditem" , IF( PATHCONTAINS( stringToCompare , PATHITEM( searchstring , [Value] ) ) , PATHITEM( searchstring , [Value] ) , BLANK() ) ) return CONCATENATEX( t , [founditem] , ", " ) ) , BLANK() ) , "Select one item from Group A" )This allows to create this report:
Hopefully, this provides some ideas on how to tackle your challenge.
Regards,
Tom
amitchandak
5 years agoSuper User
Anonymous , You can create a table like
A B
A1 B1
A2 B2
Join with table 1 on GroupA and table 2 Groupb and then you can view or filter(slicer) then together
Anonymous
5 years agoNot applicable
Thanks Amit. I expect that both my tables are going to have 1000s of rows. and I would like to select one member from Group A or B and see how that item is related to all the individual items or the opposite Group.