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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Tango2310
Helper I
Helper I

Help With query

Hi,

I am trying to transform a utc date time column to a specific timezone by using DateTime.Add Zone but cant quite get the syantax right.

 

My code is

= Table.TransformColumnTypes(#"Filtered Rows",{{"utit_quotefinaliseddate", type DateTime.AddZone(["utit_quotefinaliseddate"],10)}}))

Thank in advance for any assistance

 

Todd 

4 REPLIES 4
ronrsnfld
Super User
Super User

DateTime.AddZone does not change the underlying time. It merely adds a TimeZone segment with the stated hours offset.

To change a UTC time to the corresponding time in a specific time zone, you need to add/subtract the number of hours.

If you also want to add a time zone specifier, that is a separate operation.

 

For example, to change UTC time to Eastern Daylight Time:

Table.TransformColumns(Source, {"Date", each _ + #duration(0,-4,0,0), type datetime}),

To change UTC time to Eastern Daylight Time and also add a timezone identifier:

Table.TransformColumns(Source,{"Date", each DateTime.AddZone(_ + #duration(0,-4,0,0),-4), type datetimezone})

Original UTC Time:

ronrsnfld_0-1723681807585.png

Change to EDT:

ronrsnfld_1-1723681847854.png

 

Change to EDT and add time zone specifier:

ronrsnfld_2-1723681879791.png

 

 

 

 

Thanks for your help @ronrsnfld 

 

Looks like you cant execute this type of query on a Direct Query.

 

If that is the case, would it be then safe to say that if your using a datasource of Dataverse with any column that has a date, you would need to always use Import during your Transform process?

What is best practice in this type of scenario?

I'm sorry. Those questions are outside my area or expertise.

Anonymous
Not applicable

Pretty sure, you need to be using Table.TransformColumns, not Table.TransformColumnTypes. Also, remove the word "type".

 

--Nate

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors