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
franktby
Frequent Visitor

Customize a table combine with two tables

Hi:

    I have two tables and I want to create columns of them:

 

Table A:

phone_number    address

123                       abc

124                       asd

156                       aer

 

Table B:

phone_number    name

123                       frank

124                       Tim

188                       Jim

 

Basiclly I have table B and I'm trying to find the people's address on table A based on his phone number, the address might not there.

 

The result I want:

 

Table C:

name          phone_number      address

frank           123                        abc

Tim             124                        asd

 

 

Thanks

 

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

Hi @franktby,

 

We can merge table  A and table B in Power query as the picture below.

Capture.PNG2.PNG

 

Here is the M code in Advanced Editor for your reference.

 

let
    Source = Table.NestedJoin(TableA,{"phone_numbe"},TableB,{"phone_numbe"},"TableB",JoinKind.LeftOuter),
    #"Expanded TableB" = Table.ExpandTableColumn(Source, "TableB", {"name"}, {"TableB.name"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded TableB", each ([TableB.name] <> null))
in
    #"Filtered Rows"

Also please find the file attached.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @franktby,

 

We can merge table  A and table B in Power query as the picture below.

Capture.PNG2.PNG

 

Here is the M code in Advanced Editor for your reference.

 

let
    Source = Table.NestedJoin(TableA,{"phone_numbe"},TableB,{"phone_numbe"},"TableB",JoinKind.LeftOuter),
    #"Expanded TableB" = Table.ExpandTableColumn(Source, "TableB", {"name"}, {"TableB.name"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded TableB", each ([TableB.name] <> null))
in
    #"Filtered Rows"

Also please find the file attached.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others 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.