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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.