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
ramshoney1225
Helper V
Helper V

How to create a column from one table to another table

Hi 

I need to fullfuil the below requirement, 

I have country table with countries

I have tableA with country as foreign key 

I have tableB with country as foreign key

 

Now i want to create a calculated column/measure in Country table with TableA Calccolumn it should show TableA country values

Simillary I want to create a calculated column/measure in Country table with TableB Calccolumn it should show TableB country values

 

how to write DAX for 
TableA Calccolumn

TableB Calccolumn

 

ramshoney1225_0-1635477691969.png

 

Thanks

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached sample pbix file.

Picture1.png

 

TableA CC =
IF( Country[Country] in VALUES(TableA[Country]), Country[Country] )
 
TableB CC =
IF( Country[Country] in VALUES(TableB[Country]), Country[Country] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached sample pbix file.

Picture1.png

 

TableA CC =
IF( Country[Country] in VALUES(TableA[Country]), Country[Country] )
 
TableB CC =
IF( Country[Country] in VALUES(TableB[Country]), Country[Country] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi @Jihwan_Kim 

Thanks for your support with DAX forumla.
Its working as expected , Thank you so much.

VahidDM
Super User
Super User

HI @ramshoney1225 

 

You can create those 2 columns with RELATED dax formula if there is a relashionship between those columns or use LOOKUPVALUE dax formula.

 

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

Appreciate your Kudos!!

 

Hi @VahidDM 

 

Thanks for your support,  ya i have though of using RELATED , but my case is differnt I need to create that column in primary key table.

RELATED i'm able to get the single values in to "TableA" but I'm not able to write a DAX in to Country table 

amitchandak
Super User
Super User

@ramshoney1225 ,

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
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

Hi @amitchandak 

 

Thanks for the support, ya i have though of using RELATED , but my case is differnt I need to create that column in primary key table.

RELATED i'm able to get the single values in to "TableA" but I'm not able to write a DAX in to Country table 

Helpful resources

Announcements
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.