cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CmdrKeene Helper II
Helper II

Adjusting SharePoint Created/Modiifed Timestamp columns for TimeZone

I've got a PowerBI dashboard that is built primarily from a SharePoint list data.

 

I noticed yesterday I had neglected to account for time zone differences.  A list item was modifed yesterday at 8pm, but it showed as modified at 2am the following date in my dashboard.  I'm in central US time, so -0600 offset from UTC, so it's definitely a timezone issue.

 

So I went into my query and created a calculated column called "LocalModified" with this formula:

= Table.AddColumn(#"Renamed Columns", "LocalModified", each DateTime.AddZone([Modified],-6))

 

But it didn't return the results I expected.  I thought that perhaps I should instead just add the time zone component to the original column using this formula instead:

= Table.AddColumn(#"Renamed Columns", "LocalModified", each DateTime.AddZone([Modified],0))

 

(The only difference is I'm setting the timezone to "0" or UTC). But still not the results I wanted.

 

But researching I found this gem:

DateTimeZone.ToLocal(DateTime.AddZone([Modified],0)

 

This appears to work great in PBI desktop, but I hope it still uses central time as "local" when I upload this to the service.


CmdrKeene
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Adjusting SharePoint Created/Modiifed Timestamp columns for TimeZone

Hi @CmdrKeene 

Please refer to: https://radacad.com/solving-dax-time-zone-issue-in-power-bi

 

For example, my local time is 2020/2/12 2:55 pm, using DAX:  Now(),

it generate time 2020/2/12 2:55 pm on Power bi Desktop report, but it shows 2020/2/12 6:55 am on Power BI Service report.

My local timezone is +8 for UTC time.

 

Use dax: 

Measure 2 = NOW()+8/24

or power query

DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),8,0)

finally it shows 2020/2/12 2:55 pm on Power BI Service.

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

3 REPLIES 3
Community Support
Community Support

Re: Adjusting SharePoint Created/Modiifed Timestamp columns for TimeZone

Hi @CmdrKeene 

Please refer to: https://radacad.com/solving-dax-time-zone-issue-in-power-bi

 

For example, my local time is 2020/2/12 2:55 pm, using DAX:  Now(),

it generate time 2020/2/12 2:55 pm on Power bi Desktop report, but it shows 2020/2/12 6:55 am on Power BI Service report.

My local timezone is +8 for UTC time.

 

Use dax: 

Measure 2 = NOW()+8/24

or power query

DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),8,0)

finally it shows 2020/2/12 2:55 pm on Power BI Service.

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

CmdrKeene Helper II
Helper II

Re: Adjusting SharePoint Created/Modiifed Timestamp columns for TimeZone

Thanks! I'm going to research the DateTimezone.SwitchZone() function and see about working this into my powerQuery steps.

 


CmdrKeene
CmdrKeene Helper II
Helper II

Re: Adjusting SharePoint Created/Modiifed Timestamp columns for TimeZone

Thanks again, I believe I successfully accomplished this!  Appreciate your help.


CmdrKeene

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors