Forum Discussion

karoli_naa's avatar
karoli_naa
Frequent Visitor
6 years ago
Solved

Connect 2 columns in one

Hello!

I have 3 tables (in each column a city with different data). I need to create a new column that will include all cities from 3 tables.

For example, I have:

Table1 - Cities1

Table2 - Cities2,Country2

Table 3 - Cities3, Country3, Price

I want to have this table:

Table 4 - Column ,,Cities": Cities1 + Cities2 + Cities3

  • Hello karoli_naa 

    You can create that new table like so.

    Cities =
    DISTINCT (
        UNION (
            DISTINCT ( Table1[Cities] ),
            DISTINCT ( Table2[Cities] ),
            DISTINCT ( Table3[Cities] )
        )
    )
    

    You would go to modeling > new table and paste in this code to get a table called 'Cities'

2 Replies

  • Hello karoli_naa 

    You can create that new table like so.

    Cities =
    DISTINCT (
        UNION (
            DISTINCT ( Table1[Cities] ),
            DISTINCT ( Table2[Cities] ),
            DISTINCT ( Table3[Cities] )
        )
    )
    

    You would go to modeling > new table and paste in this code to get a table called 'Cities'

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi karoli_naa,

     

    Can you give a sample of your data (with no sensible data) so we can see what can do.

     

    Anyways you probably need to Append them all and concatenate but I don't know if your data is adaptable to this.

     

    Best Regards,

    Duarte Raminhos