Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

naturalinnerjoin date

Hi folks!!

 

Hope you are doing well, and working from home 😉

 

I started to fight with NATURALINNERJOIN function...I hope not to lose 😉

I created 2 tables which are agregation of time from 2 different sources. 

I want to join them  on the date and the location

Table 1 structure

- Date

- Location 

- Time (summation)

 

Table 2: 

- Date

- Location

- Time worked

- Vacation

 

When I use the naturalinnerjoin(Table1, Table2) function, it tells me : Date is already part of the table...which is actually the purpose 😉

 

What do I miss ?

 

PY

 

  • Anonymous's avatar
    Anonymous
    6 years ago
    Use COMBINEVALUES to create a calculated column in your tables and then create a relationship between them. Using JOINS like this in DAX is not the best solution or even Best Practice.

    Relationships are the best solution and the fastest.

    Best
    D

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous - You can use SELECTCOLUMNS when joining tables using NATURALINNERJOIN to rename any columns that are the same. In your case, if you want to join on two columns, you would likely want to concatenate those columns together and then join on that.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Dear All,

       

      Thanks for your feedback!

      Actually, I managed to use the relationships to overcome my goal. I reviewed the star schema I created...

       

      Thanks a lot

       

      PY

  • Anonymous's avatar
    Anonymous
    Not applicable
    Use COMBINEVALUES to create a calculated column in your tables and then create a relationship between them. Using JOINS like this in DAX is not the best solution or even Best Practice.

    Relationships are the best solution and the fastest.

    Best
    D