Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to Concatenate 2 columns from 2 tables

Hello,

 

I have column A from Table 1 and Column B from Table 2. I need to concatenate Column A&"_"&Column B, But this is not working as they are in different tables. If I append queries,I get nulls in either of the tables. How do I move forward on this.

amitchandak 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

    If Table 1 and Table 2 create a relationship based on any field, you can create a calculated column to get the value you want as follows by using RELATED function.

    Concatenate = 
    CONCATENATE (
        CONCATENATE ( 'Table 1'[Column A], "_" ),
        RELATED ( 'Table 2'[Column B] )
    )

    Alternatively, you can refer to the method in the cases below to implement it.

    How to concatenate values from different tables?

    Combine columns from different tables to make one table Power BI DAX
    If none of the above methods can achieve the result you want, please provide some sample data of Table 1 and Table 2, along with the correct result and a screenshot of the specific examples. If there are any special requirement or condition that need to be met, please explain them in detail. Later we will provide you a suitable solution base on your shared info. Thank you.

    Best Regards

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    If Table 1 and Table 2 create a relationship based on any field, you can create a calculated column to get the value you want as follows by using RELATED function.

    Concatenate = 
    CONCATENATE (
        CONCATENATE ( 'Table 1'[Column A], "_" ),
        RELATED ( 'Table 2'[Column B] )
    )

    Alternatively, you can refer to the method in the cases below to implement it.

    How to concatenate values from different tables?

    Combine columns from different tables to make one table Power BI DAX
    If none of the above methods can achieve the result you want, please provide some sample data of Table 1 and Table 2, along with the correct result and a screenshot of the specific examples. If there are any special requirement or condition that need to be met, please explain them in detail. Later we will provide you a suitable solution base on your shared info. Thank you.

    Best Regards