Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Understanding datetimezone type with dataflows

Hello all, I have researched this extensively but I just do not understand what is going on and what is the best fix.   I have a dataflow using a query to a sql server database. My sql query is usi...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Thank you so much for responding Anonymous ! I did see that function but was concerned about dst if I have to put the offset in manually, since sometimes my timezone is -5 and sometimes it is -4. That is why I chose to do the conversion on the sql server with 'at time zone'.

     

    I ended up calling MS Premier Support for this one and we landed on the following solution late yesterday should anyone else be struggling with this issue:

     

    SQL query must convert to UTC then to my timezone to get the time correct plus the offset which we will truncate by converting to datetime.

     

    select convert(datetime, CreatedDate at time zone 'UTC' at time zone 'US Eastern Standard Time') as CreatedDate from table

     

    Now Power BI has the time correct and no timezone, so I use the datetime type in the dataflow. This query should adjust for dst for me from the sql side.