Forum Discussion

Analitika's avatar
Analitika
Post Prodigy
6 years ago
Solved

Combine two table with conditons

I need combine two tables but with condition

Now i use

Append = Table.Combine( {Table1, Table2} ),

 

 

Tables structure is:

Table1

Code | Name

1130 | Product1

1140 | Produc3

 

Table2

Code | Name

1130 | Product1

1140 | Produc5

 

excpected result, but only on setted Codes for exmaple only if code =1140 and Name from T1 <> name from Table2

 

TableCombined

Code | Name

1130 | Product1

1140 | Produc3

1140 | Produc5

 

or

 

TableCombined

Code | Name

1130 | Product1

1140_t1 | Produc3

1140_t2 | Produc5

  • Anonymous's avatar
    Anonymous
    6 years ago

    HI Analitika,

    You can split these operations into multiple steps:

    Merged=Table.Combine( {Table1, Table2} ),//merge
    #"Remove duplicate" = Table.Combine({Table.SelectRows(Merged,each [Code]<>1140 ),Table.Distinct(Table.SelectRows(Merged,each [Code]=1140 ))})//remove duplicate of specific records and merge wth others records

    Regards,

    Xiaoxin Sheng

5 Replies