Power QueryExercises

DataFormat.Error: We couldn't parse the input provided as a DateTime value

By Tahir Nas · Examples run in our simulator · Updated

DataFormat.Error: We couldn't parse the input provided as a DateTime value.

The text isn't a date and time the culture recognises. Timestamps from logs and APIs often use formats with a T, a zone suffix or a 24-hour clock that need an explicit culture or format.

Common causes

How to fix it

  1. Give the format: DateTime.FromText(x, [Format = "dd/MM/yyyy HH:mm", Culture = "en-GB"]).
  2. Use DateTimeZone.FromText for values ending in Z or +01:00, then DateTimeZone.RemoveZone.
  3. Replace placeholders with null before converting.

Find the step that fails

Minimal example

Raises the error:

DateTime.FromText("pending")

Fixed:

DateTime.FromText("2026-03-04T09:30:00")

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

Practise avoiding it

Guides

Related lessons

Similar errors