Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jmg80525
Helper II
Helper II

Why does Power BI not recognize Snowflake TIMESTAMP_TZ as DateTimeZone

I have worked with the data engineer to ensure that timestamp data being pipelined into Snowflake is cast as Snowflake's TIMESTAMP_TZ data type; the equivilent, I assume, of DateTimeZone in SQL Sever.  The zone is specified as UTC +0.  Or at least when I query in Snowflake the results set values for timestamp seem to indicate that.

SF Query.png
I say seem to indicate that becasue if I inspect the schema it shows the Snowflake datatype as TIMESTAMP_TZ(9). What the 9 indicates is beyond me.

SF_Schema.png

However, when I bring the SF table into Power Query it doesn't recognize the the TIMESTAMP_TZ(9) as what we would refer to as DateTimeZone; it can't seem to interpret the zone and initially casts it as DateTime.  If I change the type to DateTimeZone it applies a UTC zone of -6.  
PBI.png

Uhhh? O.K. Why?
For kicks and giggle I thought I would cast the values stored as TIMESTAMP_TZ as VARCHAR expecting to see the the offset portion to be expressed at +0000. Below is what I get.

 

SF Cast as Varchar.pngAnyone else had luck with with TIMESTAMP_TZ (aka DateTimeZone) data in Snowflake?

7 REPLIES 7
jmg80525
Helper II
Helper II

To the best of my determination, the Snowflake datatype TIMESTAMP_TZ is not ISO_8061 compliant and that is the what Power BI is looking for to cast the data as DATETIMEZONE as opposed to DATETIME.  Here's what I did to formulate that response.

 

  • Create a trial account in SF

Generated the following SQL:

 

ALTER SESSION SET TIMESTAMP_TYPE_MAPPING = TIMESTAMP_TZ;
CREATE TABLE tstx_test (timestamp_tz TIMESTAMP_TZ);
INSERT INTO tstx_test (timestamp_tz) VALUES (CURRENT_TIMESTAMP());

Assured that timestamp column casted correctly

jmg80525_1-1731012280378.png

 

 

Ran SQL against the newly formed table. Result below.

jmg80525_2-1731012301601.png

 

 

Brought the data into PBI Desktop and the transformation editor.  By default, PBI recognizes it as DateTime

 

Of pbidt.png

 

If convert the column in PBI to DateTimeZone it applies my local time (MST-UTC(-7) zone to the timestamp. Which is not what is stored in Snowflake as shown on top. 

 

pbidtz.png

 

Please inform me if I'm missing something.

The standard is called ISO 8601

 

Apart from that (and for a second ignoring the fact that your server is not running on UTC (!!!)) it looks like the datetimezone value is accurate.   11am Pacific is 12pm Mountain.

 

What is your expectation - to see the UTC time?

lbendlin
Super User
Super User

Your TIMESTAMP_TZ result is not ISO-8601 conform.  Add the T  and it will work just fine.  It will work just fine without it too, but that's besides the point.

 

lbendlin_0-1730841929747.png

 

 

 

Could you clarify? Here's a better snapshot of what I'm seeing. PBItoUTC.png The data stored in Snowflake is cast as TIMESTAMP_TZ with the timezone being UTC(Z).  For whatever reason, PBI does not recoginzie the Snowflake data type being what it would call DateTimeZone.  Are you suggesting that the Snowflake data type TIMESTAMP_TZ is not ISO_8061 compliant?  As you can see the transformation step I applied to create PBI_TIMESTAMP_DTZ (DTZ being DateTimeZone) I simply took the DateTime value from the first column and concatenated the zone as text.  I fully realize I can transform the data into what I need.  What I want to understand is why PBI doesn't cast Snowflake TIMESTAMP_TZ as DateTimeZone when pulling data from it.  Any insights are greatly appreciated. 

 

For whatever reason, PBI does not recoginzie the Snowflake data type being what it would call DateTimeZone

 

The reason is that the incoming data assumes UTC, but does not explicitly specify it. Can you ask your data engineer to help you change the query so the timestamp comes across in proper ISO-8601 ?

 

Or continue doing what you are doing - slap "+000"  onto the text.  Or use DateTime.AddZone

 

lbendlin_0-1730876507414.png

 

Anonymous
Not applicable

I'm sure you know that Z is for ZULU time. But perhaps Power Query is changing it to your local time zone.

 

--Nate

I didn't know that Z meant Zulu and I didn't realize the each hourly offset from the Prime Meridian is also represented by a letter.  HT to Wikipedia

 

 I'm in MST -7 (T, Tango) with my Power BI Desktop running on  a local laptop, but I am VPNed to the corp office which is in CST -6 (S, Sierra).  (Sorry, had to employ my newly learned knowledge:)  I have no idea why it would choose -6 when casting to DateTimeZone in Power Query.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors