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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Shailu198
Helper I
Helper I

Creating new calculated field using multiple columns from multiple tables

Hi All,

 

I have a scenario where i want to create a calculated column which is using two other columns from 2 other tables.

I have 3 tables as  - labor_terminations, employee & workday_cost_centers. These three tables are connected with each other.

labor_terminations is connected with workday_cost_centers and employee is also connected with workday_cost_centers.

Please find the screenshots for understanding the relation.

 

When i am trying to create new column in labor_terminations i want one column from employee and one from workday_cost_centers. Since labor_terminations is not directly connected with employee it is not showing any column of employee table even with the use of related keyword.

 

Capture.JPG

 

Any help would be greatful.

 

Regards,

Shailesh

 

1 REPLY 1
Eric_Zhang
Employee
Employee


@Shailu198 wrote:

Hi All,

 

I have a scenario where i want to create a calculated column which is using two other columns from 2 other tables.

I have 3 tables as  - labor_terminations, employee & workday_cost_centers. These three tables are connected with each other.

labor_terminations is connected with workday_cost_centers and employee is also connected with workday_cost_centers.

Please find the screenshots for understanding the relation.

 

When i am trying to create new column in labor_terminations i want one column from employee and one from workday_cost_centers. Since labor_terminations is not directly connected with employee it is not showing any column of employee table even with the use of related keyword.

 

Capture.JPG

 

Any help would be greatful.

 

Regards,

Shailesh

 


@Shailu198

The snapshot shows the table labor and employ are in a many-to-many relationship, so you'll have to use RELATEDTABLE. So to create a calculated column in the table labor, the DAX shall be like

calculated column = SUMX(RELATEDTABLE(employee),employee[somecolumn])

For further advice, please post some smaple data nd expected output.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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