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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Convert data from UTC to Local Time

Hello Everyone,

 

I know this issue has been brought up many times.

Post in community is mostly rely on simply add | minus some hours

https://community.powerbi.com/t5/Desktop/Convert-Date-Column-from-UTC-to-Central-Time/m-p/818704#M39...

https://community.powerbi.com/t5/Desktop/Custom-Query-Function-to-convert-UTC-to-EST/m-p/1106780#M51...

 

I am in New Zealand, we have daylight saving on winter, and daylight-saving time is based on criteria as "First Sunday in April" making logic very complicate.

 

Is there a elegant way of achieving UTC to NZDT/NZST?

 

Best

5 REPLIES 5
AlexisOlson
Super User
Super User

If your input is in DateTimeZone format already, then you might be able to use DateTimeZone.ToLocal.

 

If not, then you can probably use DateTime.AddZone as explained here:

https://community.powerbi.com/t5/Desktop/Convert-utc-to-local-time-zone-using-Power-Query/td-p/45533

Anonymous
Not applicable

@AlexisOlson Hello Alexis,

 

Not sure I got it correct or not, based on my understanding,

#datetimezone(https://docs.microsoft.com/en-us/powerquery-m/sharpdatetimezone)

requires a predefined  offset-hours + offset-minutes 

 

The complicate case here is that offset-hour is not a fixed value, it changes twice a year... same applies to DateTime.AddZone

Anonymous
Not applicable

Anonymous
Not applicable

Thank you for your reply.

 

Basically the ideas of the post is still manually define when to switch the exact hours on difference.

The complexity comes from first sunday of certain month...

 

there is a big chuck of logical code written to detect first sunday of some month.
I know how to achieve just think it would be nice to add a easier timezone convert function, which can be a more elegant method.

Greg_Deckler
Community Champion
Community Champion

@Anonymous - I have a time zone solution in my book DAX Cookbook, it is Recipe 9 I think of Chapter 3. https://github.com/gdeckler/DAXCookbook

 

Also, there is a DAX function's UTCNOW and UTCTODAY and in Power Query there are methods as well: https://community.powerbi.com/t5/Community-Blog/How-To-Convert-UTC-to-Your-Local-Time-Zone-in-Power-Query/ba-p/976650

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.