Forum Discussion

JamesGordon's avatar
JamesGordon
Helper II
6 years ago
Solved

Merging table info

Hi,

 

I have two tables and i am looking to combine some of the infomation.

 

Essentially table 1 contains a small list of "stock number" and "outstanding amounts" and table 2 contains contains huge list of "Stock number" , "model" and "customer"

 

I am looking to create a DAX column that can place the "model" and "customer" along side the "stock number" in table 1 if they match. Picture below for illustration.

 

Im guessing I'll need to create DAX column for Model and another DAX column for Customer?

 

  • Hi JamesGordon 

    Do you have one-to-one relationships between table1 and table2 by [Stock Number] field?

    if so, you dont even need to code smth - just add columns from table 2 to visual

  • Hi JamesGordon , You can add extra columns in your Table 1 with:

     

    Model = RELATED(Table2[Model])
    Customer = RELATED(Table2[Customer])
     
    That ofcourse, assuming your tables have 1 to 1 Relationships. In which case, you can also do as suggested by az38 .

    If those suggestions work for you, kindly mark them as solutions to enable others benefit from them.

3 Replies

  • az38's avatar
    az38
    Community Champion

    Hi JamesGordon 

    Do you have one-to-one relationships between table1 and table2 by [Stock Number] field?

    if so, you dont even need to code smth - just add columns from table 2 to visual

  • ahmedoye's avatar
    ahmedoye
    Responsive Resident

    Hi JamesGordon , You can add extra columns in your Table 1 with:

     

    Model = RELATED(Table2[Model])
    Customer = RELATED(Table2[Customer])
     
    That ofcourse, assuming your tables have 1 to 1 Relationships. In which case, you can also do as suggested by az38 .

    If those suggestions work for you, kindly mark them as solutions to enable others benefit from them.