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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
PBI_Rookie
Helper I
Helper I

Timezone Switch

I have a report that is being refreshed on the service. 

 

As with so many others I'm trying to convert UTC to a local timezone. I've read many similar posts but still not getting something quite right.  My end goal is to set up a relative date filter to show data from Today. This of course works, until it is tomorrow in UTC.  

 

Here is where I currently am

I've made copied one of my datetimestamp fields in my data set and made it into a timezone using

DateTime.AddZone([#"Login Time - Copy"],0)

PBI_Rookie_0-1649040531029.png

 

from here I tried converting to my desired timezone using switchzone

DateTimeZone.SwitchZone ([Sample Login as UTC],-7)

 

I've then used DateTimeZone.RemoveZone([Pacific Conversion]) to try and achieve what i was after. 

 

The end result is so far the same, I'm still stuck with today being based on UTC. What did I miss?

 

PBI_Rookie_0-1649045832798.png

 

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PBI_Rookie ,

 

You could use #duration().

https://docs.microsoft.com/en-us/powerquery-m/sharpduration 

[datetime]+#duration(0,-7,0,0)
DateTime.LocalNow()+#duration(0,-7,0,0)

vjaywmsft_0-1649404500633.png

 

Best Regards,

Jay

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @PBI_Rookie ,

 

You could use #duration().

https://docs.microsoft.com/en-us/powerquery-m/sharpduration 

[datetime]+#duration(0,-7,0,0)
DateTime.LocalNow()+#duration(0,-7,0,0)

vjaywmsft_0-1649404500633.png

 

Best Regards,

Jay

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors