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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
h4tt3n
Helper V
Helper V

Need help converting Date/Time timestamp to different timezone

Hello all,

 

I have a "TimeStamp" column of datatype Time/Date that I want to offset by 2 hours from UTC to my local time zone. It needs to be Time/Date because I use it for incremental refresh, which only accepts this datatype. 

 

I have created a new custom column called TimeStampLocal = DateTime.AddZone( [TimeStamp], 2 ) which contains the correct time, but it is of datatype Any, which isn't recognized as a date in my visuals.

 

If I change the datatype of TimeStampLocal to Date/Time or Date/Time/Timezone in power query, the timezone does not show in the table after saving and closing the query editor.

 

As soon as I am back in the Power BI desktop editor, the column has switched back to Date/Time, and in the column tool I can't change it to Date/Time/Timezone datatype.

 

What is going on, is this a bug or am I doing it wrong? How can I make this work?

 

Thanks in advance, Mike

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Not familiar with that function but it does to be different than I expected.  Simple fix is just to add 2 hours to your datetime columns as follows

=[DateTimeColumn] + #duration(0,2,0,0)

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@h4tt3n , refer if these can help

https://www.poweredsolutions.co/2019/10/21/handling-different-time-zones-in-power-bi-power-query/
https://community.powerbi.com/t5/Desktop/Convert-UTC-to-client-time-zones/td-p/56337
https://www.youtube.com/watch?v=M1zquwmpnZE

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
mahoneypat
Microsoft Employee
Microsoft Employee

Not familiar with that function but it does to be different than I expected.  Simple fix is just to add 2 hours to your datetime columns as follows

=[DateTimeColumn] + #duration(0,2,0,0)

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


This worked, thank you.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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