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

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

Reply
mr_fnord
Frequent Visitor

Local Datetime to UTC, inconsistent behavior from DateTimeZone.From()

I have a datatable from a SQL database with a local datetime column [DeliveryDateTime] that I need to join to other tables with UTC times. 

 

I am using a Custom Column with the formula:

DateTimeZoneLocal = DateTimeZone.From([DeliveryDateTime])

 

When I add this step, I get a result that treats [DeliveryDateTime] as a UTC time:

mr_fnord_0-1619640501009.png

which is not what the documentation describes.

 

If I add another Custom column step, either before or after the DateTimeZone.From step, suddenly the DateTimeZone.From starts assigning the local timezone.

 

Added column:

Custom= DateTime.AddZone([DeliveryDateTime], -11) (arbitrary datetimezone function, offset doesn't matter, before or after the From function doesn't matter)

Result:

mr_fnord_1-1619640783639.png

If I remove the Custom column in another step, the DateTimeZoneLocal resets back to UTC (+0).

 

Can anyone else recreate this behavior? Is there any way to describe this except as a bug?

3 REPLIES 3
selimovd
Super User
Super User

Hey @mr_fnord ,

 

I think you have to put the "cultural" parameter for the DateTimeZone.From function:

DateTimeZoneLocal = DateTimeZone.From([DeliveryDateTime], "en-US")

 

Otherwise Power Query doesn't know which local date this is.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Adding a culture works, but why the inconsistent behavior based on other datetimezone functions?

 

Hey @mr_fnord ,

 

what do you see as inconsistent behavior?

 

Best regards

Denis

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.