Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Converting numbers to text?

Hi all ,

 

I want to combine 2 text fields and 2 number fields , but i keep getting the error Expression . Error :  We cannot convert the value to type Logical.

 

Some Raw Data :

 

TextField1NumberField1TextField2NumberField2
India4500Apples14749
US6500Nuts65757
UK8500Peas43442

I need to combine them to one column like :

India - 4500 - Apples - 14749

 

Any help appreciated, thanks.

  • Anonymous 

    please try this.

    =[Column1]&"-"&Number.ToText([Column2])&"-"&[Column3]&"-"&Number.ToText([Column4])

     

4 Replies

  • Anonymous 

     

    Is this what you want?

    Column = 'Table (2)'[Column1]&"-"&'Table (2)'[Column2]&"-"&'Table (2)'[Column3]&"-"&'Table (2)'[Column4]

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes , but in power query , isnt this in DAX?

      Sorry to not have mentioned that.

      • ryan_mayu's avatar
        ryan_mayu
        Icon for Super User rankSuper User

        Anonymous 

        please try this.

        =[Column1]&"-"&Number.ToText([Column2])&"-"&[Column3]&"-"&Number.ToText([Column4])

         

  • Anonymous , Try like

    new column = [TextField1] & " - "& [NumberField1] & " - "& [TextField2] & " - "& [NumberField2]