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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Madxfr
Frequent Visitor

Create one table from 2 tables (inner join)

Hello,

 

I have 2 tables with:

 

Table1

id  Col1 Col2 Col3

1   A      BB      2

1   A      CC      4

1   B      AA      5

2   A      CC      10

2   B      AA      6

2   C      CC      8

2   A      CC      10

3   D      BA      6

3   H      FC      8

 

Table2

id  Col1 Col2 Col3

1   XX4     1      2

1   AA5     5     4

1   BB1      8     5

3   AC1      9    10

3   BD2     10    6

3   C      CC      8

 

Result expected:

Table_Res

id  Col3

1   2

1   4

1   5

3   6

3   8

 

I need to create a table with column id and Col3 from Table1 but only where id included in table2.

A kinf of : select id,col3 from table1 inner join table2 on table1.id=table2.id

 

Thanks for your help.

 

 

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

HI @Madxfr ,

You can use values function to extract table 2 id and use 'in' operator to compare with these fields:

NEW Table =
SELECTCOLUMNS (
    FILTER ( Table1, [id] IN VALUES ( Table2[id] ) ),
    "id", [id],
    "Col3", [Col3]
)

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

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Madxfr ,

You can use values function to extract table 2 id and use 'in' operator to compare with these fields:

NEW Table =
SELECTCOLUMNS (
    FILTER ( Table1, [id] IN VALUES ( Table2[id] ) ),
    "id", [id],
    "Col3", [Col3]
)

Regards,

Xiaoxin Sheng

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

Thanks, it's faster than merge table and so simple when you have the solution 😉

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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