Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

CROSSJOIN by group

hi all, Hopefully you can help me. I can't figure it out despite googling a lot. I don't think it's very tricky. Basically, what I want to achieve is a kind of grouped crossjoin between two identic...
  • Anonymous's avatar
    Anonymous
    6 years ago
    // Assumption:
    // No relationship between the tables.
    
    GENERATE(
    	'Table A',
    	var __stop = 'Table A'[Stop]
    	return
    	SELECTCOLUMNS(
    		CALCULATETABLE(
    			VALUES( 'Table B'[Stations] ),
    			'Table B'[Stop] = __stop
    		),
    		"B Stations",
    			'Table B'[Stations]
    	)
    )