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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
TTPP81
Frequent Visitor

Create column based on data from another table

Table 1: Register for Grade - It keeps all the grade IDs and Model Names/ Family

 

Table 2: Register for Grade Issues - It keeps all the issues of the Models

 

Help! I want to create a column named “Tracking Column” in Table 2. What codes / measures / conditions should I use?

 

IF Model Name/Family in Table 2 has a Family according to Table 1 - Family Column, then ‘Tracking Column’ in Table 2 will reflect the Model Family Name. In this instance, Credit 3 Model in Table 2 belongs to Credit Family Model. Tracking column will pick up its Family from Table 1 – Model Family column and list Credit family Model in Tracking column.

 

IF Model Name /Family in Table 2 has no family name according to Table 1 i.e. N/A, then tracking column will only reflect the Model Name in Model Name/Family in Table 2. Example, Frequency Check Model.

 

Hope it makes sense! 

 

Register for Grade.JPGRegister for Grade Issues.JPG

@BA_Pete 

1 ACCEPTED SOLUTION
shafiz_p
Super User
Super User

Hi @TTPP81  To acheive the Tracking column according to your condition, follow the steps mentionded below:

Considering you have both the tables in power query, if not bring them in power query.


1. Open power query and click merge queries. See images below (Red Highlighted):

shafiz_p_0-1729485669775.png

2. You will ge the below window, select Model Name/Family column from Table2 in upper table and Model Name From Table1 in lower table. Click Ok. See Image below:

shafiz_p_1-1729485880063.png

3. Click double arrow head Icon in Table1 column and expand only Family column from Table1. See image below:

shafiz_p_2-1729486028928.png

You will get below screen:

shafiz_p_3-1729486071053.png

4. Create a custom conditional column. Codition would be:

If [Family] = null then [Model Name/Family] else if [Family] = N/A then [Model Name/Family] else [Family]

See images below:

shafiz_p_4-1729486222909.png

 

After click ok, you will get your desired result. Remove Family Column. See the output below, as your requirement:

shafiz_p_5-1729486326818.png

 

Hope this helps!!

If this solved your problem, please accept it as a solution!!

 

Best Regards,
Shahariar Hafiz

View solution in original post

3 REPLIES 3
Omid_Motamedise
Super User
Super User

Please  provide the data in type table

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
shafiz_p
Super User
Super User

Hi @TTPP81  To acheive the Tracking column according to your condition, follow the steps mentionded below:

Considering you have both the tables in power query, if not bring them in power query.


1. Open power query and click merge queries. See images below (Red Highlighted):

shafiz_p_0-1729485669775.png

2. You will ge the below window, select Model Name/Family column from Table2 in upper table and Model Name From Table1 in lower table. Click Ok. See Image below:

shafiz_p_1-1729485880063.png

3. Click double arrow head Icon in Table1 column and expand only Family column from Table1. See image below:

shafiz_p_2-1729486028928.png

You will get below screen:

shafiz_p_3-1729486071053.png

4. Create a custom conditional column. Codition would be:

If [Family] = null then [Model Name/Family] else if [Family] = N/A then [Model Name/Family] else [Family]

See images below:

shafiz_p_4-1729486222909.png

 

After click ok, you will get your desired result. Remove Family Column. See the output below, as your requirement:

shafiz_p_5-1729486326818.png

 

Hope this helps!!

If this solved your problem, please accept it as a solution!!

 

Best Regards,
Shahariar Hafiz

Thank you, it worked. Appreciate your help

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.