Forum Discussion

schrjenn's avatar
schrjenn
New Member
1 year ago
Solved

How to normalize time zones

I have a data table with times from multiple different time zones. Looking for a way to normalize the times so that they all appear as Central Time within the report. So far I have not found a dynamic way to do that works.

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi schrjenn 

    First, creating a static Time Zone Offset Table that contains all time zones and their offsets relative to UTC.

     

     

     

    Assume your data table contains the following columns:

     

    Then use DAX to create a calculat column converted to UTC.

     

    UTC_Time = 
    VAR TimeZoneOffset =
    LOOKUPVALUE(
    'Time zone offset'[UTCOffset],
    'Time zone offset'[TimeZone], 'DataTable'[TimeZone]
    )
    RETURN
    'DataTable'[Timestamp] + TimeZoneOffset / 24

     

     

    Result:

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • Hello schrjenn,

     

    Can you please try this approach:

    Adjusted Time = 
    DATEADD(
        'Table'[OriginalTime],
        LOOKUPVALUE('TimeZoneOffsets'[Offset], 'TimeZoneOffsets'[TimeZone], 'Table'[TimeZone]),
        HOUR
    )
    
  • Are the original data points in UTC or do they originally come from different timezones?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi schrjenn 

    First, creating a static Time Zone Offset Table that contains all time zones and their offsets relative to UTC.

     

     

     

    Assume your data table contains the following columns:

     

    Then use DAX to create a calculat column converted to UTC.

     

    UTC_Time = 
    VAR TimeZoneOffset =
    LOOKUPVALUE(
    'Time zone offset'[UTCOffset],
    'Time zone offset'[TimeZone], 'DataTable'[TimeZone]
    )
    RETURN
    'DataTable'[Timestamp] + TimeZoneOffset / 24

     

     

    Result:

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.