Forum Discussion

Data_Analystz's avatar
Data_Analystz
Regular Visitor
3 years ago
Solved

DateTime column is adding one hour automatically when imported

Hi Friends, I have column in SQL table which is actually date column but it is in NVARCHAR (MAX).

 

Current value in SQL table is 

2023-04-30T23:56:07.949+0000

 

After importng it in Power BI, by default PBI is showing it as TEXT column. When righ click and change the format to DateTime. The value becomes as 01/05/2023 00:56:08

 

1 hour is added to the result. May I know why and how to fix this issue. I have 8 date fields ðŸ˜‚

 

 

  • ppm1's avatar
    ppm1
    3 years ago

    In the query editor, delete the existing Changed Type step and then click on the icon on left side of the column name and choose datetimezone.

     

     

    Pat

4 Replies

  • ppm1's avatar
    ppm1
    Solution Sage

    It is likely converting to your local timezone. Try converting it to datetimezone instead of datetime.

     

    Pat

    • Data_Analystz's avatar
      Data_Analystz
      Regular Visitor

      Can you please help me how to do that? And I dont want the field t display timezone in my visuals

      • ppm1's avatar
        ppm1
        Solution Sage

        In the query editor, delete the existing Changed Type step and then click on the icon on left side of the column name and choose datetimezone.

         

         

        Pat

    • wojciech's avatar
      wojciech
      Helper II

      Hi ppm1 ,

       

      Having converted datetime to timezone shows me how many hours is my time shifted by but it still shows incorrect date. Do I need to create a calulated column to correct the date?

       

      Thanks,

       

      WJ