Forum Discussion

MK_Aqipa's avatar
MK_Aqipa
Frequent Visitor
8 years ago
Solved

Power query - concatenate text columns

Hi,

I need to combine two text columns. I've tried it in the custom column with the & Formuala, but I get an error. 

= Table.AddColumn(#"Geänderter Typ", "Text.Combine", each [FCURR]&[Period])

 

Anyone has an idea how i can solve it?

 

thanks in advance,

regards

  • MK_Aqipa,

     

    is [FCURR] and [Period] of type Text? What is the error you get?

     

    Also, where is your function Text.Combine( )? It looks like you've just joined with '&' which should give you something like:

     

    [Column1]&[Column2]
    
    outputs 'helloworld'
    Text.Combine({[Column1],[Column2]}," " )
    
    outputs 'hello world'

     

3 Replies

  • ChrisMendoza's avatar
    ChrisMendoza
    Resident Rockstar

    MK_Aqipa,

     

    is [FCURR] and [Period] of type Text? What is the error you get?

     

    Also, where is your function Text.Combine( )? It looks like you've just joined with '&' which should give you something like:

     

    [Column1]&[Column2]
    
    outputs 'helloworld'
    Text.Combine({[Column1],[Column2]}," " )
    
    outputs 'hello world'

     

    • MK_Aqipa's avatar
      MK_Aqipa
      Frequent Visitor

      thanks for your fast reply....with two text columns it worked now :-)

       

      =Text.Combine({[FCURR],[TCURR]}," " )

       

       

  • The trick when concatenating values is to make sure they are of the Text sort. 

     

    So either:

    - Make sure the entire column is text

    - Use a function that transforms the value to text during the evaluation. 

     

    I think anyone struggling with this may enjoy this article: 

     

    https://gorilla.bi/power-query/concatenate-values/

     

    Also take into account that referencing null values may result in different values.

     

    --------------------------------------------------

     

    @ me in replies or I'll lose your thread

     

    Master Power Query M? -> https://powerquery.how

    Read in-depth articles? -> BI Gorilla

    Youtube Channel: BI Gorilla

     

    If this post helps, then please consider accepting it as the solution to help other members find it more quickly.