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 September 15. Request your voucher.

Reply
efilipe
Helper IV
Helper IV

Get value from another table

Hi guys!

 

I have 3 tables (that has more columns than that, of course)

 

1) CLIENT

CLIENT_ID

CITY_NAME

 

2) PROVIDER

PROVIDER_ID

CITY_ID

 

2) CITY

CITY_ID

CITY_NAME

 

For the 3 tables, I'm loading though CSV file.

 

The problem is the Client table doesnt have the ID, but the City name. I want to change that column to CITY_ID.

 

Can anyone help me on that? 🙂 Thank you!!! 🙂

2 ACCEPTED SOLUTIONS
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @efilipe

 

Have you had a play with the Merge Tables feature in the Query Editor?

 

It's really good and may help you produce a table that combines this data into a single table.

 

mergeQ.png

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

Anonymous
Not applicable

Hi @efilipe,

 

You can try to use Table.Join and Table.SelectColumns to achieve your requirement:

 

Sample:

let
    Source1= Table.SelectColumns(CITY,{"CITY_ID","CITY_NAME"}),
    Source2= Table.SelectColumns(CLIENT,{"CLIENT_ID","CITY_NAME"}),
    Source = Table.SelectColumns(Table.Join(CLIENT,"CITY_NAME",CITY,"CITY_NAME",JoinKind.LeftOuter),{"CLIENT_ID","CITY_ID"})
in
    Source

 

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @efilipe

 

Have you had a play with the Merge Tables feature in the Query Editor?

 

It's really good and may help you produce a table that combines this data into a single table.

 

mergeQ.png

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil,

 

Dont know if thats the best way to go, bcause I'm giving one example, bu it happens 5 times... And this table is appended to another one after the changes... But I'll try. Thanks!

Anonymous
Not applicable

Hi @efilipe,

 

You can try to use Table.Join and Table.SelectColumns to achieve your requirement:

 

Sample:

let
    Source1= Table.SelectColumns(CITY,{"CITY_ID","CITY_NAME"}),
    Source2= Table.SelectColumns(CLIENT,{"CLIENT_ID","CITY_NAME"}),
    Source = Table.SelectColumns(Table.Join(CLIENT,"CITY_NAME",CITY,"CITY_NAME",JoinKind.LeftOuter),{"CLIENT_ID","CITY_ID"})
in
    Source

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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