Forum Discussion

cherrybi_com's avatar
cherrybi_com
Frequent Visitor
4 months ago
Solved

How to convert UTC to local time in Power BI using ICAO code (with DST handling)

I have a fact table which contains Time column stored in UTC, and a Icao column (ICAO airport code) that identifies where each flight was handled. I need to convert the UTC time to the correct local time for each airport, accounting for Daylight Saving Time (DST).

  • Hi cherrybi_com 

    UTC time can be converted to a local timezone in Power Query, but the conversion is generally offset-based rather than rules-based. In practice, Power Query typically adds or subtracts a fixed number of hours from a datetime value. It does not inherently determine whether a location is currently observing daylight saving time (DST), nor does it automatically apply historical or regional DST transition rules unless that logic is explicitly built into the solution. As a result, a simple UTC offset (for example, UTC+10) may be correct part of the year but incorrect when DST shifts the local time to UTC+11.


    Another limitation is that Power Query does not natively understand location identifiers such as airport or market codes like an ICAP airport code. It does not recognize that a code may correspond to a specific geography, time zone, or set of DST rules. For that, a mapping table is typically needed to translate the code into a timezone identifier or offset before any conversion can be applied.

     

    Below is an example of timezone conversion

    // converts a datetimezone value from UTC to UTC+11
    DateTimeZone.SwitchZone([UTC DateTimeZone Column], 11)

5 Replies

  • Hi cherrybi_com 

    UTC time can be converted to a local timezone in Power Query, but the conversion is generally offset-based rather than rules-based. In practice, Power Query typically adds or subtracts a fixed number of hours from a datetime value. It does not inherently determine whether a location is currently observing daylight saving time (DST), nor does it automatically apply historical or regional DST transition rules unless that logic is explicitly built into the solution. As a result, a simple UTC offset (for example, UTC+10) may be correct part of the year but incorrect when DST shifts the local time to UTC+11.


    Another limitation is that Power Query does not natively understand location identifiers such as airport or market codes like an ICAP airport code. It does not recognize that a code may correspond to a specific geography, time zone, or set of DST rules. For that, a mapping table is typically needed to translate the code into a timezone identifier or offset before any conversion can be applied.

     

    Below is an example of timezone conversion

    // converts a datetimezone value from UTC to UTC+11
    DateTimeZone.SwitchZone([UTC DateTimeZone Column], 11)
    • cherrybi_com's avatar
      cherrybi_com
      Frequent Visitor

      If someone is in Italy and travels to another country, the time will adjust to the local time of the destination, not remain as Italy’s time.

      So, the displayed time always depends on the current location’s time zone, including any applicable daylight saving changes.

  • v-karpurapud's avatar
    v-karpurapud
    Icon for Community Support rankCommunity Support

    Hi cherrybi_com 

    Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to  123abc  and danextian  for sharing valuable insights.

     

    Could you please confirm if your query has been resolved by the provided solution?If you have any more questions, please let us know and we’ll be happy to help.

    Regards,

    Microsoft Fabric Community Support Team.

  • v-karpurapud's avatar
    v-karpurapud
    Icon for Community Support rankCommunity Support

    Hi cherrybi_com 

    I'm following up since we haven't heard back yet. Have you had a chance to look over the information above? Please let us know if you have any further questions.

    Thank You.