cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Power Participant

## Add column from a different table

I have 2 tables "similar" to below

Table 1

 ID Company Code Country City 1 50 Blah Blah 2 60 Blah Blah 3 50 Blah Blah 4 31 Blah Blah

Table 2

 ID Company Code Company Name Country City 1 50 Company 1 Blah Blah 2 60 Company 2 Blah Blah 3 50 Company 1 Blah Blah 4 30 Company 3 Blah Blah

How can I get the "Company Name" column in "Table 2" to display in "Table 1" so it puts the correct "Company Name" alongside the associated"Company Code" and if there is no corrosponding "Company Code" in "Table 2", then leave "Blank".   Similar to below...

Table 1

 ID Company Code Company Name Country City 1 50 Company 1 Blah Blah 2 60 Company 2 Blah Blah 3 50 Company 1 Blah Blah 4 31 Blah Blah

I am unsure the best approach to do this.  Thanks in advance.

1 ACCEPTED SOLUTION
Solution Sage

Hi @StuartSmith
Create an active relationship between Table 1 and Table 2 based on a common column like ID or Company Code.

Now go to your Table 1, add a new column and use below DAX;

CompanyName=RELATED(Table2[Company Name])

Thanks,
Sanket.

If this post helps, then mark it as "Accept as Solution" and give it a thumbs up.

2 REPLIES 2
Resolver I

Hi, how are u?

First of all you should create a relation between these tables in here:

You just need to drag "Company" from table1 to "Company" from table2.

After, if you move the information from different table in the same chart, the information will match.

Regards!

Solution Sage

Hi @StuartSmith
Create an active relationship between Table 1 and Table 2 based on a common column like ID or Company Code.

Now go to your Table 1, add a new column and use below DAX;

CompanyName=RELATED(Table2[Company Name])

Thanks,
Sanket.

If this post helps, then mark it as "Accept as Solution" and give it a thumbs up.

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors