Forum Discussion

ericOnline's avatar
ericOnline
Post Patron
7 years ago
Solved

Convert utc to local time zone using Power Query

Hello,    Does anyone have a better example for how to add hours (DateTime.AddZone) to a date-time value? The docs are not clear on this: DateTime.AddZone(#datetime(2010, 5, 4, 6, 5, 5), 8) equals...
  • v-danhe-msft's avatar
    v-danhe-msft
    7 years ago

    Hi ericOnline,

    Based on my test, you could refer to below steps in query editor:

    Add custom column:

    if [ID]=1 then [Date]+#duration(0,2,0,0) else if [ID]=2 then[Date]+#duration(0,1,0,0) else null

    Result:

     

    You could also download the pbix file to have a view.

     

    Regards,

    Daniel He