- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adjust Power BI Query Time to be Dynamic with Daylight Savings Begins/Ends Formulas
I'm attempting to account for Daylight Savings Begins/Ends in my Time Refresher and was successful until I got to this part. I use Pacific Standard Time (United States) so need to subtract hours instead of adding.
I used this video and was successful until this part at the 13 minute mark. This person is using time outside of the US.
What I think my formula should look like.
Can I possibly edit CurrentDateTime here to be minus, so then I can just add hours to my if CurrentDateTime formula.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DateTimeZone.SwitchZone() will accept negative numbers.
Here is a small example...
let
spring_forward_utc = #datetimezone(2025,3,9,10,0,0,0,0),
example_table =
#table(
{"dateTimeUTC"},
{
{#datetimezone(2025,3,9,09,59,32,0,0)},
{#datetimezone(2025,3,9,10,00,35,0,0)}
}
),
change_type =
Table.TransformColumnTypes(
example_table,
{{"dateTimeUTC", type datetimezone}}
),
add_local =
Table.AddColumn(
change_type,
"Local Time",
each
if [dateTimeUTC] >= spring_forward_utc
then DateTimeZone.SwitchZone([dateTimeUTC], -7)
else DateTimeZone.SwitchZone([dateTimeUTC], -8),
type datetimezone
)
in
add_local
Proud to be a Super User! | |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DateTimeZone.SwitchZone() will accept negative numbers.
Here is a small example...
let
spring_forward_utc = #datetimezone(2025,3,9,10,0,0,0,0),
example_table =
#table(
{"dateTimeUTC"},
{
{#datetimezone(2025,3,9,09,59,32,0,0)},
{#datetimezone(2025,3,9,10,00,35,0,0)}
}
),
change_type =
Table.TransformColumnTypes(
example_table,
{{"dateTimeUTC", type datetimezone}}
),
add_local =
Table.AddColumn(
change_type,
"Local Time",
each
if [dateTimeUTC] >= spring_forward_utc
then DateTimeZone.SwitchZone([dateTimeUTC], -7)
else DateTimeZone.SwitchZone([dateTimeUTC], -8),
type datetimezone
)
in
add_local
Proud to be a Super User! | |

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
03-28-2022 12:48 AM | |||
03-22-2024 05:08 AM | |||
11-10-2023 03:21 PM | |||
Anonymous
| 10-09-2020 10:41 AM | ||
11-20-2023 02:52 AM |
User | Count |
---|---|
27 | |
26 | |
25 | |
13 | |
10 |
User | Count |
---|---|
24 | |
21 | |
19 | |
17 | |
10 |