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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Libin7025
Frequent Visitor

Dynamic DAX for UTC to EDT (Daylight time) conversion.

Dynamic EDT&EST = VAR OriginalDateTime = src_system_info[loaded_at]
VAR CurrentYear = YEAR(TODAY())

// Calculate the second Sunday of March for the current year

VAR MarchFirst = DATE(CurrentYear, 3, 1)
VAR Weekdayofmarchfirst = WEEKDAY(MarchFirst)

VAR MarchSecondSunday =

SWITCH(
    true(),
    Weekdayofmarchfirst = 1, MarchFirst + (7 - Weekdayofmarchfirst) + 1,
    Weekdayofmarchfirst > 1, MarchFirst + (14 - Weekdayofmarchfirst) + 1
)

//Calculate the first sunday of November for current year
VAR NovemberFirst = Date(CurrentYear, 11, 1)
VAR NovemberFirstSunday = NovemberFirst + (7 - WEEKDAY(NovemberFirst)) + 1  

VAR EDTStart = MarchSecondSunday // Second Sunday of March
VAR ESTStart = NovemberFirstSunday // First Sunday of November

VAR AdjustedDateTime =
    SWITCH(
        TRUE(),
        OriginalDateTime >= EDTStart && OriginalDateTime < ESTStart,
        OriginalDateTime - TIME(4, 0, 0),  // Eastern Daylight Time (EDT) UTC offset is -4 hours

        OriginalDateTime >= ESTStart && OriginalDateTime < EDTStart + 365, // Transition occurs within a year
        OriginalDateTime - TIME(5, 0, 0),  // Eastern Standard Time (EST) UTC offset is -5 hours

        TRUE(),
        BLANK()
    )

RETURN
    FORMAT(AdjustedDateTime, "DD MMM YYYY") & " at " & FORMAT(AdjustedDateTime, "hh:mm:ss AM/PM") & IF(HOUR(AdjustedDateTime) = 0, " ET", " EDT")
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Libin7025 Is this a question or a post on a helpful DAX calculation? If the latter, you might consider posting it to the Quick Measures Gallery. Quick Measures Gallery - Microsoft Fabric Community



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...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Libin7025 Is this a question or a post on a helpful DAX calculation? If the latter, you might consider posting it to the Quick Measures Gallery. Quick Measures Gallery - Microsoft Fabric Community



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...

It's a helpful DAX calculation. Thanks for directing me to the right path to post this. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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