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
- Building a label such as "Invoice " & [Number].
- Joining a date to text for a period key.
- A column you expected to be text was typed as a number by Changed Type.
How to fix it
- Convert the non-text side: "Invoice " & Text.From([Number]).
- For dates, choose the format: Date.ToText([Date], "yyyy-MM").
- Use Text.Combine({"Invoice", Text.From([Number])}, " ") when joining several parts.
Find the step that fails
- Open the query in the Power Query editor (Excel: Data → Queries & Connections → Edit; Power BI Desktop: Transform data).
- Click the steps in Applied Steps from the top. The first step that shows the error is where it starts; later steps only repeat it.
- Read that step's formula in the formula bar (View → Formula Bar if it's hidden) and compare it with the columns and values the previous step produced.
Minimal example
Raises the error:
"Invoice " & 1042Fixed:
"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
- beginner~6 minFree
Keep order numbers' leading zeros (kite shop)
Type a CSV so order numbers stay text (0007, not 7) while quantities and prices become numbers.
- intermediate~7 minFree
Split a timestamp into its date and hour (door access)
Each event has a text timestamp like 2026-03-04T14:30:00. Add a real Date and the Hour of day.
- beginner~5 minFree
Make a mixed number/text code column all text (garden centre)
Product codes arrive as a mix of numbers (1001) and text (A-17, 0042). Make every code text.
- beginner~5 minFree
Build a date from year, month and day columns (deliveries)
A legacy export stores dates as three number columns. Combine them into one real date.