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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Copy value from one table to another on matching IDs

I have a header and detail table that are linked by an unique ID. Both tables are imported from SQL server management studio. The header table has a column which I would like to add to the detail table. What would be the correct (and most efficient) way to copy this header column to the detail column considering the databases consists of a couple million rows. 

 

The header table looks like this (other columns have been left out of the example):

ID                                                                                                            Type

1A
2B

 

The detailed table should look like this: 
Type column is what I want to add to my table.

ID                                                                                                             Type

1A
1A
1A
2B
2B
1 ACCEPTED SOLUTION

Gotcha, this one is pretty straightforward. I am using names that are different than yours for clarity, but this is how you will do it:

1. Create a relationship between 'Header_Table'[ID_Number] and 'Detail_Table'[ID_Number]

2. Add a column to 'Detail_Table' with the formula ID Number = RELATED('Header_Table'[Type])

 

Let me know if you have any questions.

View solution in original post

3 REPLIES 3
ntaylo06
Resolver II
Resolver II

A clarification question, are you adding "1" and "2" to the detailed table or "A" and "B"?

Anonymous
Not applicable

I would like to add the "Type" column to the detailed table. In the example that would be "A" and "B". 

Gotcha, this one is pretty straightforward. I am using names that are different than yours for clarity, but this is how you will do it:

1. Create a relationship between 'Header_Table'[ID_Number] and 'Detail_Table'[ID_Number]

2. Add a column to 'Detail_Table' with the formula ID Number = RELATED('Header_Table'[Type])

 

Let me know if you have any questions.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.