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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
davidwsw
Frequent Visitor

Converting UTC to local time with daylight saving

I have a date column in my database table in UTC and I want to convert it to my local time (Eastern Time), taking into account daily saving.

 

I tried to do it using the following PowerQuery functions:

  • DateTime.AddZone to add the time zone to the UTC time
  • DateTimeZone.ToLocal to convert UTC to local
  • DateTimeZone.RemoveZone to remove the time zone from the converted time

I also found some posts where people tried to do their own conversion.

https://community.powerbi.com/t5/Power-Query/Convert-Date-Time-in-UTC-to-Local-Time-with-Daylight-sa...

Do the PowerQuery functions not handle the conversion correctly? I'm a bit confused as to why further calculations are needed.

 

The screenshot below shows the result after using the PowerQuery functions. It looks like the time offset changed from -4 hours to -5 hours at 6AM UTC or 2AM Eastern time.

PowerQuery convert to local time.png

 

When I do the conversion using "AT TIME ZONE" in SQL, the result is slightly different.

https://learn.microsoft.com/en-us/sql/t-sql/queries/at-time-zone-transact-sql?view=sql-server-ver16

 

Here it looks like the offset changed from -4 hours to -5 hours at 2AM UTC.

SQL convert to local time.png

 

Which result is correct? The one in SQL or the one from PowerQuery?

 

 

 

 

 

 

 

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Please see this video for one way to handle DST. Note that it works in desktop but not in the service.

(7) An easy way to handle Daylight Savings Time in Power Query - YouTube

 

Pat

Microsoft Employee

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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