Power QueryExercises

Expression.Error: We cannot convert the value to type Date

By Tahir Nas · Examples run in our simulator · Updated

Expression.Error: We cannot convert the value "2026-01-31" to type Date.

A date function such as Date.AddDays or Date.Year received text, not a date. The column still holds text because its type was never changed, or it was changed after this step.

Common causes

How to fix it

  1. Convert first: Date.AddDays(Date.From([OrderDate]), 30).
  2. Move the Changed Type step above the step that uses the dates.
  3. Set types again after Table.Combine or an expand, which can reset them.

Find the step that fails

Minimal example

Raises the error:

Date.AddDays("2026-01-31", 30)

Fixed:

Date.AddDays(Date.From("2026-01-31"), 30)

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

Guides

Related lessons

Similar errors