ETLMCPData Conveyance Works
Log in Start free
Guides

'Yesterday' in Power BI, Tableau, Looker Studio and Metabase: UTC vs the account's day

Why 'Yesterday' and 'Last 7 days' can pick the wrong day on etlmcp data in Power BI, Tableau, Looker Studio and Metabase, and how to anchor them.

A "Yesterday" or "Last 7 days" filter asks the BI tool what today is, and several tools answer in UTC. etlmcp's date column is a plain calendar day that each platform chose in its own reporting zone, usually the ad account's. For several hours of every day the two disagree: the filter picks a day that is not finished yet in the account's zone, or skips the latest one, and numbers look missing or low. The fix is to anchor relative filters to the data, or to tell the tool which zone you mean.

What etlmcp's date column holds

In PostgreSQL, etlmcp writes date as a date column, with no time and no time zone. Every other column is a number or text. The stored rows are described as dated "in the account's own timezone" in the data endpoint's own description (query data). Which zone that is depends on the platform:

Platform Whose day the date is
Meta, Google Ads, TikTok the ad account's time zone
GA4 the property's time zone
LinkedIn, Pinterest UTC days
Microsoft Advertising reports are requested with the London zone, so that the "today" Microsoft checks the range against is never behind UTC

So a table that mixes an account in Los Angeles with one in Berlin holds two different definitions of the same date. No BI setting turns those into one; compare them as each platform's day.

Power BI

Once a report is published, relative date slicers and filters are always worked out from the time in UTC, whoever views it. The relative week options assume weeks start on Sunday, with no way to change that. Power BI date columns carry no time zone either.

For etlmcp data, use the Date picker slicer style with the Last date anchor. It counts the relative range back from the newest date in the column, not from the UTC today, so "last 7 days" means the last seven days the platform has reported. Use the calendar options (such as Months (Calendar)) to compare whole periods; they leave out the partial current one.

Tableau Cloud

For extract-based data sources, NOW() and TODAY() in calculated fields use the site's time zone for extracts, and that is UTC unless a site administrator changes it. If your accounts report in one zone, ask the site administrator to set the site to that zone. If they report in several, filter on the latest date in the data instead of on TODAY().

Data Studio (formerly Looker Studio)

TODAY() with no argument returns today in UTC. Pass a zone to get the account's today: TODAY("America/Los_Angeles"). Use that in a calculated field such as a "days ago" field, and filter on it rather than on the built-in rolling ranges when the hour matters.

Weekly rolling ranges start on Sunday. If your reporting week starts on Monday, choose the options marked "(starts Monday)", such as "Last week (starts Monday)".

Metabase

Metabase's Report timezone setting decides the zone for relative filters such as "Previous 30 days", for grouping by day or week, and for dates in results, on the databases that support it, PostgreSQL and BigQuery among them. Set it to the zone your main accounts report in. It changes nothing stored in your database. The first day of the week defaults to Sunday.

Writing your own SQL in PostgreSQL

Keep comparisons between dates. When you compare a date with a timestamp, PostgreSQL treats the date as midnight in the session's TimeZone, so the result shifts with that setting, whose built-in default is GMT (servers usually override it in their configuration). Write

WHERE date >= current_date - 7 AND date < current_date

rather than comparing date with now(), and run SHOW TimeZone; to see which zone your session uses. To follow the data instead of the clock, anchor to the newest stored day:

WHERE date > (SELECT max(date) FROM ads) - 7

Related

Sources

  1. Create a Relative Date Slicer or Filter in Power BI — learn.microsoft.com, checked
  2. Set the Site Time Zone for Extracts — docs.salesforce.com, checked
  3. TODAY — docs.cloud.google.com, checked
  4. Set a date range for your report — docs.cloud.google.com, checked
  5. Languages and localization — www.metabase.com, checked
  6. Date/Time Functions and Operators — www.postgresql.org, checked
  7. Client Connection Defaults — www.postgresql.org, checked