Forum Discussion

FAW71's avatar
FAW71
Advocate I
1 month ago
Solved

Create a new column with concat

Hello,

I am trying to do a simple concat of the ID a hyphen and the title as a new column in Power Query but I keep getting a "Token Literal expect" error. I am not sure what it's looking for.

I know this can be done with DAX but I am trying to learn Power Query at the same time here.

Can you help?

 

  • The error is caused by the extra commas. plus if [Id] has values such as numbers, convert to text before concatenating. Use this M code: 

    Text.From([Id]) & " - " & [Title]

2 Replies

  • I got it to work. I have to use Number.ToText() to convert the ID to text and then use just the ampersan without the comma.

    =Number.ToText([ID]) & " - " & [Title]
  • The error is caused by the extra commas. plus if [Id] has values such as numbers, convert to text before concatenating. Use this M code: 

    Text.From([Id]) & " - " & [Title]