Forum Discussion

smpa01's avatar
smpa01
Icon for Community Champion rankCommunity Champion
4 years ago
Solved

Constructing table in Dax from Variables

I am trying to figure out how can I end with a table from at least two variables My code is following   Table = VAR first = "a" VAR second = "b" VAR x= CROSSJOIN(DATATABLE("column1",STRING,{...
  • parry2k's avatar
    4 years ago

    smpa01 Not sure if this is what you are looking for? You can do crossjoin these two variables and rename the column name, or use selectcolumns and then cross join

     

    Table = 
    VAR a = {"a","b","c"}
    VAR b = {"e", "f","g"}
    RETURN
    CROSSJOIN ( SELECTCOLUMNS ( a, "First", [Value] ), SELECTCOLUMNS ( b, "Second", [Value] ) )

     

    or you want row 1 of each table to  join and then row 2 to row 2 and so on...

    what is your end goal?