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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Hewes_uk
New Member

Power BI: Joining 2 tables using a calculated column

I have 2 tables which I would like to join in Power BI.

 

The first table is part of a large model to which I'm connecting. In that model is a table with a list of IDs.

 

Table 1

IDSome PropertyAnother PropertySomething elseetc
1adgetc
2behetc
3cfietc

 

I also have a Excel document (from MS Forms) which I'm importing into a second table.

 

Table 2

Dateidentifieranswer 1answer 2etc
20241001xy112adetc
20241002pl225beetc
20241002xy112cfetc

 

I would like to add a calculated column into table 2 which would be an ID. Thereafter I could join table 1 and table 2 using that [id] field (one to one).

 

I have a number of rules which I can use to work out which record from table 1 is being referenced by a record in table 2 (some of which are based on table 1, some of which are based on other tables within the existing model).

 

Is there a way of calculating an [id] field in table 2, and then using that to join back to table 1?

 

Many thanks in advance.

 

1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @Hewes_uk 

 

yes, it is possible to calculate a value from one table to another table but you need a comparable value between those two tables.

 

for example in your sample tables, i assumed it is a random data so i take 'Table 1'[Some Property] is same data as 'Table 2'[answer 1].

Irwan_0-1733356265200.png

basically the DAX will compare the value from 'Table 1'[Some Property] and 'Table 2'[answer 1].

If any value matched, then it would return 'Table 1'[ID] in calculated column Table 2.

 

Hope this will help.

Thank you.

View solution in original post

2 REPLIES 2
v-jianpeng-msft
Community Support
Community Support

Hi, @Hewes_uk  

I wish you all the best. Previously Irwan provided a solution to help you solve the problem. Since I see that Irwan's proposed solution fulfills your needs, I would like to confirm if you have successfully solved this issue or if you need further help?
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.

 

Best Regards

Irwan
Super User
Super User

hello @Hewes_uk 

 

yes, it is possible to calculate a value from one table to another table but you need a comparable value between those two tables.

 

for example in your sample tables, i assumed it is a random data so i take 'Table 1'[Some Property] is same data as 'Table 2'[answer 1].

Irwan_0-1733356265200.png

basically the DAX will compare the value from 'Table 1'[Some Property] and 'Table 2'[answer 1].

If any value matched, then it would return 'Table 1'[ID] in calculated column Table 2.

 

Hope this will help.

Thank you.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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