Unsupported function: 'FN_DATETIME_SUB' error

I have an existing Looker dashboard that uses a calculated field with DATETIME_SUB to compare month-over-month data views. As of yesterday (8/19/25), I get the following Data Set Configuration Error when loading the report:

“Unsupported function: ‘FN_DATETIME_SUB’ Error ID: d3bef199”.

Here is the line that is creating the error:

CASE WHEN QUARTER(ImportedDate_MST) = QUARTER(DATETIME_SUB(TODAY(“America/Denver”), INTERVAL 1 QUARTER)) AND YEAR(ImportedDate_MST) = YEAR(DATETIME_SUB(TODAY(“America/Denver”), INTERVAL 1 QUARTER)) THEN CreatedTransactions ELSE 0 END

Could someone look into this to see why this is now occurring?

11 Likes

+1

i also encountered similar issue. DATETIME_DIFF now produces errors breaking reports.

But found workaround by creating a seperate field that contains the nested CASE function, and then using this seperately-created field into DATE_DIFF.

Unfortunate DATE_DIFF only outpurs DAYS intervals instead of the flexible time period options which DATETIME_DIFF provides in “part” parameter.

Hello, I’m getting the same error, but for DATETIME_ADD.

I’ve noticed this error occurs when a field or value includes one of these functions: DATETIME_ADD, DATETIME_SUB, or DATETIME_DIFF.

Specifically, I’m seeing this error in the following situations:

  • Graphs that use a field or value containing a DATETIME_ADD (or SUB, DIFF) function.

  • Integrated data sources where a field or value includes one of these functions.

  • Extracted data sources that include fields with these functions.

I use these functions frequently, and this issue is having a significant impact on my work. I hope this can be fixed as soon as possible.

4 Likes

I have a formular QUARTER(datetime_add(Post Date, interval 6 day)), it’s used to work but broken since yesterday. after testing myself, I found the function Quarter () has the error. Datetime_add works, Date() work, but Quarter() brokes my dashboard. and it happen with dataset from Google Sheet. another dataset from Bigquery still alive

2 Likes

Hello, I’m getting the same error, for DATETIME_ADD, DATETIME_SUB.

Creating additional fields does not solve the problem. Source google sheets.

The reports are not working.

1 Like

I’m thinking of transfer Google sheet to Bigquery, another step but it might solve our problem for now

Hello everyone,

I’m encountering a DATETIME_SUB related issue, similar to what others have reported. I’m trying to calculate the number of orders for the current week using a CASE statement.

Here is the formula I’m using:

SQL

CASE
  WHEN
    Order_Date >= DATETIME_SUB(CURRENT_DATE(), INTERVAL IF(WEEKDAY(CURRENT_DATE()) = 0, 6, WEEKDAY(CURRENT_DATE()) - 1) DAY)
    AND Order_Date <= CURRENT_DATE()
  THEN Order_Count
  ELSE 0
END

My data source is Google Sheets.

I’m getting the following error message:

Dataset Configuration Error Looker Studio can't connect to the dataset. Failed to fetch data from the underlying dataset.

Could anyone please help me troubleshoot this issue? Thank you!

Same issue with me. FN_DATETIME_DIFF not supported error

Do you guys think the problem is Google Sheet? maybe the datetime format from Google Sheet has some issue, so the datetime function in Looker return error.

I use the same function for data from BigQuery, but got no issue, only problem come from Google Sheet data.

1 Like

Same here.

+1
Several charts across multiple Looker reports are suddenly broken because of this.

I didn’t understand. And why is this error not being corrected? This is clearly a mistake. And no one writes that at least some work is currently underway to eliminate it. Why now redo a report that worked and now doesn’t work through no fault of mine?

It could be the case, but theoretically, the data in Looker Studio has already had its fields configured as date fields. That said, using BigQuery is also an excellent suggestion.

If the current DATETIME_SUB() approach doesn’t work, I will ‘temporarily’ switch to using the YEARWEEK() method instead.

Similar error with Datetime_ADD() here, but was able to diagnose that it only breaks when using future dates. In my case, the real problem was adding a week to current date (or a month, breaks the same way). Trying to read the Week number of a future date (or the Month number) breaks the report. .

this doesnt work (Weeknumber is the fieldname):
if(Weeknumber = WEEK(TODAY()),“This week”,
if(Weeknumber = WEEK(DATETIME_ADD(TODAY(), INTERVAL 1 WEEK)),“Next week”, “None”))

this works:
if(Weeknumber = WEEK(TODAY()),“This week”,
if(Weeknumber -1 = WEEK(TODAY()),“Next week”, “None”))

Calling this is enough to break the report:
WEEK(DATETIME_ADD(TODAY(), INTERVAL 1 WEEK))

But this works fine:
DATETIME_ADD(TODAY(), INTERVAL 1 WEEK)

I have faced the same issue as @GilesAlonso

I use these functions to create blends where I can put month and month and year on year comparisons in the same table. Using WEEK(), MONTH(), or YEAR() on a datetime add function failed.

However I found that I could bypass the DATETIME_ADD function by simply using MONTH(my_date)+1 and it would add a single month as expected and turn it into an integer. While not the best for viewing in tables, it allowed me to build my month on month blends (in combination with a CASE WHEN for the end of the year)

I would still like to see a fix for this sometime soon!

My code for reference:

To get the current month as an integer: Month(Date)+0

To get the next month as an integer:

CASE
    WHEN MONTH(Date) = 12 THEN 1
    ELSE MONTH(Date) + 1
END

Thanks for the feedback everyone! Unfortunately, Google STILL hasn’t resolved this issue and all of the suggestions provided did not work for me.

I ended up revising my underlying MySQL queries to do the DATE_SUB within the query itself versus using Looker’s in-built DATETIME_SUB function.

1 Like

Hello

, an error appears in the period option; the calendar does not appear to enter the date.

I am getting the same error on a report that has had no changes and has previously been working for years.

Anything we can do to get Google to prioritize this? Is there an issue tracker or something we can +1?

1 Like

Same here, using function DATETIME_DIFF.

ROUND(DATETIME_DIFF(max(date), MIN(date), DAY) / 30, 0)