Expression.Error: We cannot apply operator to types Text and Number
By Tahir Nas · Examples run in our simulator · Published · Updated
Expression.Error: We cannot apply operator + to types Text and Number.
An arithmetic or comparison operator received values of incompatible types. M doesn't convert text to numbers automatically.
Common causes
- A numeric column is still text after import.
- Comparing with a quoted number: [Qty] > "0".
- Concatenating text and numbers with & or +.
How to fix it
- Set column types right after importing.
- Remove quotes from numeric literals.
- Use Text.From(number) when building text, and & for concatenation.
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:
"5" + 1Fixed:
Number.From("5") + 1Both 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.