Tableau error Dates
DATEDIFF is being called with (string, date, string)
One of your dates is stored as text. DATEDIFF needs two real dates, so a string field such as Ship Date fails. Convert it with DATE() first, or DATEPARSE() if DATE cannot read the format.
Which formula raises it, and what fixes it?
DATEDIFF('day', [Order Date], [Ship Date])The xmetric engine rejects it too.
DATEDIFF('day', [Order Date], DATE([Ship Date]))On each of the 3 example rows it returns:
| Region | Order Date | Ship Date | Result |
|---|---|---|---|
| East | 2025-01-05 | 2025-01-09 | 4 |
| West | 2025-02-10 | 2025-02-11 | 1 |
| West | 2025-03-01 | 2025-03-08 | 7 |
Why it works. DATE() turns the text "2025-01-09" into a date, so both arguments are dates and DATEDIFF can count the days between them. The 'day' part stays a string; that one is supposed to be text. Changing the field's type to Date in the data source fixes it for every calculation.
The 3 example rows
Region | Order Date | Ship Date |
|---|---|---|
| East | 2025-01-05 | 2025-01-09 |
| West | 2025-02-10 | 2025-02-11 |
| West | 2025-03-01 | 2025-03-08 |
What else raises this message?
Raises it
DATEDIFF('day', [Ship Date], TODAY())Fixed
DATEDIFF('day', DATE([Ship Date]), TODAY())The text field must be converted before date math. DATE parses ISO text such as 2025-03-14.
Checked on the xmetric engine: the first fails, the fix runs.
Raises it
DATEDIFF('month', [Ship Date], [Order Date])Fixed
DATEDIFF('month', DATE([Ship Date]), [Order Date])Either argument can be the text one; convert whichever it is.
Checked on the xmetric engine: the first fails, the fix runs.
Does my formula have this problem?
Paste your formula and run it on the example rows. It uses the fields [Region], [Order Date], [Ship Date]; rename yours to match.
Runs in your browser on the xmetric engine. Nothing is uploaded.
Which functions does this involve?
What do people ask about this error?
Why is my date column text in the first place?
Tableau reads a column as text when even a few values don't parse as dates, or the format is unusual (like 14.03.2025). Change the field type in the data pane, or convert it with DATE or DATEPARSE.
When should I use DATEPARSE instead of DATE?
Use DATEPARSE with an explicit pattern when the text isn't in a standard format: DATEPARSE('dd.MM.yyyy', [Ship Date]).
Where is this message documented?
- Where the message is reported (help.tableau.com) checked October 17, 2026