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
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
Employee
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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Phil_Seamark
Employee
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!

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.