Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Join two tables repeating rows

So, I think it's a simple problme, but I can't resolve it on time.

 

I have a table A with two columns: Employee and Code.

And table two with two columns too: Code and Course.

 

Table 1:

 

Table 2:

 

I want to make a third column joining the info from table 2 to table 1, but not on Power Query it has to be with DAX.

The final result is something like this:

Can anyone help, please?

 

  • NewTable=GENERATE(Table1,CALCUATETABLE(VALUES(Table2[Course]),TREATAS(VALUES(Table1[Code]),Table2[Code])))

2 Replies

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Icon for Community Champion rankCommunity Champion

    NewTable=GENERATE(Table1,CALCUATETABLE(VALUES(Table2[Course]),TREATAS(VALUES(Table1[Code]),Table2[Code])))

    • Anonymous's avatar
      Anonymous
      Not applicable

      It works. Thank you!!