Forum Discussion

GeorgW's avatar
GeorgW
Helper II
5 years ago
Solved

Display/insert data from one table into another

Hello,

I have two tables; the "Employees" table and the "Additional Information" table. I now want to copy from the "Additional Information" table the values from the fields "Company", "Contract" and "Contract type" to the "Employees" table, where the fields "Employee ID", "Year" and "Month" are identical.

 

Employees table:

 

 

 

 

Additional Information table:

 

 

What is the formula for the "Employees" table?

  • I have solved it now with "CONCATENATE" (the Employee ID, Year and Month) and then with "LOOKUPVALUE". And it works 🙂

5 Replies

    • GeorgW's avatar
      GeorgW
      Helper II

      Thank you very much. But that is - I think - not the solution. I have presented the two tables in a very simplified way; they are already combined tables with much more information, so another combination won't work. Besides, I have several "key columns" (employee ID, year AND month). Can't I solve it with a formula?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  GeorgW ,

    Here are the steps you can follow:

    1. Create calculated table.

    Table 2 = SUMMARIZE('Table',
    'Table'[Employye ID],'Table'[Name],'Table'[birthdate],'Table'[sex],'Table'[Department],'Table'[Location],'Table'[Year],'Table'[Month],
    "Company",CALCULATE(MAX('Table (2)'[Company])),
    "Contract",CALCULATE(MAX('Table (2)'[Contract])),
    "Contract type",CALCULATE(MAX('Table (2)'[Contract type]))
    )

    2. Result.

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • unfortunately this does not work either. Employee ID (= identifier for the employee) cannot be in a 1:1 relationship, because every month the employees are added.
    So Brad Pitt always has employee ID 2, and then it does not work with this solution.

     

    What I think that it must be work, there should be three new calculated columns (one each for "Company", "Contract" and "Contract type") in the table "Employee Table", where the three fields "Employee ID", "Year" and "Month" are used to find a match in the other table ("Additional Information table") and then the respective value (Company, Contract and Contract type) is transferred to each calculated column.

     

    but what is the formula for this?

  • I have solved it now with "CONCATENATE" (the Employee ID, Year and Month) and then with "LOOKUPVALUE". And it works 🙂