Power QueryExercises

Expression.Error: We cannot apply operator & to types Text and Number

By Tahir Nas · Examples run in our simulator · Updated

Expression.Error: We cannot apply operator & to types Text and Number.

& joins two texts (or two lists, or two records). When one side is a number or a date, M raises this error instead of converting it for you.

Common causes

How to fix it

  1. Convert the non-text side: "Invoice " & Text.From([Number]).
  2. For dates, choose the format: Date.ToText([Date], "yyyy-MM").
  3. Use Text.Combine({"Invoice", Text.From([Number])}, " ") when joining several parts.

Find the step that fails

Minimal example

Raises the error:

"Invoice " & 1042

Fixed:

"Invoice " & Text.From(1042)

Both snippets are run by the Power Query Exercises simulator on every build: the first must raise Expression.Error, the second must run.

Practise avoiding it

Related lessons

Similar errors