Forum Discussion

aishak12's avatar
aishak12
Helper IV
5 years ago
Solved

Joining two columns into one

Hi All, 

 

I am importing my data with SQL and have two columns (RECOMMENDED_BLK & RECOMMENDED_LOT). I would like to comine these values into a new column while having a slash between them. 

 

For instance new column values = 6490/002, 5893/001B, 5889/001. Is this possible? 

 

 

 

 

 

  • Hi aishak.

    You can inside power query add a custon column with the code below

    Text.Combine({Text.From([RECOMMMENDED_BLK], "pt-BR"), "/", [RECOMMENDED_LOT]})

     

    best regards.

5 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Community Champion
    = Table.AddColumn(#"prev step", "Concat", each [RECOMMENDED_BLK] & "/" & [RECOMMENDED_LOT])

     

    Btw, why not concatenate columns in sql?

    SELECT CONCAT(RECOMMENDED_BLK, '/', RECOMMENDED_LOT) AS RECOMMENDED_CONCAT

    or

    SELECT (RECOMMENDED_BLK + '/' + RECOMMENDED_LOT) AS RECOMMENDED_CONCAT

    if "+" operator is supported by your db.

    • aishak12's avatar
      aishak12
      Helper IV

      Hi, 

      I am receiving this error. I am trying to do this in PowerBI if possible. Thanks 

       

       

  • Portrek's avatar
    Portrek
    Resolver III

    Hi aishak.

    You can inside power query add a custon column with the code below

    Text.Combine({Text.From([RECOMMMENDED_BLK], "pt-BR"), "/", [RECOMMENDED_LOT]})

     

    best regards.

    • aishak12's avatar
      aishak12
      Helper IV

      I am receiving error for some reason. Do you have any clue what the issue is? 

    • aishak12's avatar
      aishak12
      Helper IV

      This worked thank you. Recommended_BLK had three M's in your response.