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
Ayappan
Helper III
Helper III

Create new column based fields from different tables

Hi ,

     I want to create a column with the feilds in 2 different tables 

     Example  : TableA [column1,column2]

                       TableB [column3,column4]

So new column in TableA as column5  = ( (TableA [column1] + TableB [column3]  ) /  ( TableA [column2] + TableB [column4]) )

 

Thanks 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi   @Ayappan ,  

Maybe you should create relationships between these tables base on primary column like date or ID. If you just want plus them directly, you can add index column in power query editor. 

vchenwuzmsft_0-1646115302402.png

(assume primary column is [index] ) 

vchenwuzmsft_2-1646115375904.png

 

Then use below expression to get column5 in tableA. 

Column5 =
DIVIDE (
[column1] + RELATED ( TableB[column3] ),
[column2] + RELATED ( TableB[column4] )
)
 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

 

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi   @Ayappan ,  

Maybe you should create relationships between these tables base on primary column like date or ID. If you just want plus them directly, you can add index column in power query editor. 

vchenwuzmsft_0-1646115302402.png

(assume primary column is [index] ) 

vchenwuzmsft_2-1646115375904.png

 

Then use below expression to get column5 in tableA. 

Column5 =
DIVIDE (
[column1] + RELATED ( TableB[column3] ),
[column2] + RELATED ( TableB[column4] )
)
 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

 

amitchandak
Super User
Super User

@Ayappan , You need to have some join condition to bring that value in table B

 

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

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.