Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
GeorgW
Helper II
Helper II

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:

employees.jpg

 

 

 

 

Additional Information table:

Additional Information.jpg

 

 

What is the formula for the "Employees" table?

1 ACCEPTED SOLUTION
GeorgW
Helper II
Helper II

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

View solution in original post

5 REPLIES 5
GeorgW
Helper II
Helper II

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

GeorgW
Helper II
Helper II

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?

v-yangliu-msft
Community Support
Community Support

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.

v-yangliu-msft_0-1605862057584.jpeg

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.

 

amitchandak
Super User
Super User

@GeorgW , You can merge in power Query and keep the required columns

https://radacad.com/append-vs-merge-in-power-bi-and-power-query

Video: https://www.youtube.com/watch?v=zNrmbagO0Oo

 

Dax you can do column by column: https://www.youtube.com/watch?v=czNHt7UXIe8

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.