Convert UTC datetime to local time zones in Power Query

Поделиться
HTML-код
  • Опубликовано: 29 дек 2024

Комментарии • 114

  • @NaraMeerammaTrust
    @NaraMeerammaTrust 5 лет назад +2

    Ruth, I too have the same question. will it work the same way on Power BI Service Apps where users will be login from Different Time zones across the country. Can you please clarify it?

    • @CurbalEN
      @CurbalEN  5 лет назад +1

      Well, Power bi app displays date and time on utc based on where the report has been publish (which server and where the server is located). So I don’t see how it will display different time zones unless the user refreshes the data set and power bi releases the cache... so... multiple time zones?? Gotta think about it...
      /Ruth

    • @NaraMeerammaTrust
      @NaraMeerammaTrust 5 лет назад +1

      @@CurbalEN Please let us know Ruth, if it works out for Apps too. If it works based on the user TimeZone where he is located and opens the App. The whole purpose of Power Bi Service is to view/ refresh Dashboards on service and be ready to serve audience. Right? I am so curious to know the solution if it works or not.

    • @CurbalEN
      @CurbalEN  5 лет назад +1

      It worked for me, now that you have the power bi file, publish it on your power bi service to check if it works.
      The issue is same power bi file multiple time zones I think...
      /Ruth

    • @NaraMeerammaTrust
      @NaraMeerammaTrust 5 лет назад

      Curbal thanks a lot Ruth. I will also try from my side. Thank you

    • @sandhyak2817
      @sandhyak2817 3 года назад +1

      ​@@NaraMeerammaTrust did this worked in power bi service. I am trying to display users local time (dynamically) on each report as "Refreshed On:" . I am implemented using "_timeonezoneoffset" and other DAX functions works fine in power bi desktop. Once I published the report it's taking UTC timezone which is default timezone for power bi service. Kindly let me know if you have any inputs.

  • @jeanlorenth4023
    @jeanlorenth4023 5 лет назад

    Thank you so much!!! took me 2 days reading a zillion of articles to accomplish what I needed and could only do it when watching this video, creating the Queries before formatting the data was KEY!!!...I needed to create calculations with data collected in UTC-6 and display it in UTC-6!!! but after publishing it kept going back to UTC messing with some of the data and calculations. After watching your video I replaced the step "DateTimeZone.ToLocal" to "DateTimeZone.SwitchZone-([UTC-ExtractedFromAColumn],0).. In order to always display the information in the time zone it was collected...
    Thanks for Sharing!!!!

    • @CurbalEN
      @CurbalEN  5 лет назад

      Awesome! Glad it helped ;)
      /Ruth

  • @dakshayanin9127
    @dakshayanin9127 Год назад

    When it comes to Power BI, most of the time you are my lifer saver :)

  • @apoorvupadhyaya7899
    @apoorvupadhyaya7899 5 лет назад

    I created a report that was connected to a Sharepoint List. Was facing a similar issue - SP list had the correct time (CST time for me) but the Power BI reports were off by 5-6 hours (UTC). Your video helped me solved it. Thank you so much! I can see this trick being useful in the future

    • @CurbalEN
      @CurbalEN  5 лет назад

      Wonderful!!
      /Ruth

    • @AlbertodaSilva1972
      @AlbertodaSilva1972 2 года назад

      Didn't you have an issue when data was refreshed in Power BI Services?

  • @dizzyharris2658
    @dizzyharris2658 3 года назад +5

    This can be done a little simpler with the Power BI Desktop GUI also accounting for DST.
    1. In Power Query select all of your DateTime columns. Format those as DateTimeZone.
    2. With those columns still selected, Select Time and Local Time under the transform Column.
    3. Again with those columns selected Format those back to DateTime. (we do this for Time Intelligence. In my experience, if you miss this step it breaks your relationship to a Date Calendar.)

    • @flaviojardim9306
      @flaviojardim9306 Год назад

      thanks for sharing knowledge. I followed your method and it worked, and in a simple way.

  • @praveenpatil282
    @praveenpatil282 4 года назад

    This is helpful. My users are now well informed about when the dataset was last refreshed, avoids a lot of confusion.

  • @miroslavvitek5248
    @miroslavvitek5248 5 лет назад +5

    What about DST when converting to UTC. What if the worldcup would be when DST change the number of hours you need to add or substract?

  • @ele4853
    @ele4853 3 года назад

    Would you show how to just transform UTC to local time. Off course the gap time is variable depending where we live. No dates or days just the time? Say UTC 00:25, or 14:55... thanks

  • @rajeshn8751
    @rajeshn8751 2 года назад

    Awesome Ruth, thank you for sharing this... been breaking my head over this since morning.

  • @BigRedFishDad
    @BigRedFishDad 3 года назад

    another great video... I had UTC time stored already and I am trying to do an hourly report. I tried several of these to convert but they just kept giving me the -06:00 at the end and then when I changed to DateTime it showed the same time. This worked perfectly for me and I know have 8:00 am times instead of 2pm!!!!

  • @mwaltercpa
    @mwaltercpa 4 года назад +1

    This is the best thing I've learned in Query all month! Thanks!!

  • @hithere0kei
    @hithere0kei 2 года назад

    Thanks a lot! Worked like a charm!

  • @laranapoli1426
    @laranapoli1426 3 года назад +1

    Is there a way to make the change in the original columns? (without adding a new one)

  • @mwaltercpa
    @mwaltercpa 3 года назад

    #duration in M worked great to adjust in PQ. Thanks for the helpful video!

  • @pablosaizortuno4740
    @pablosaizortuno4740 Год назад

    wowwww, very very good explained. Very usefull! Thanks!

  • @rainvillegonzales2203
    @rainvillegonzales2203 2 года назад

    Just what I needed! Thank you very much!

  • @dcpowered
    @dcpowered 3 года назад

    Thank you sooo much for the step by step explanation!! I liked and subscribed! Excellent video!!

  • @maizaimen8866
    @maizaimen8866 5 лет назад +1

    Hi, I am working with Real time data and i used power bi as output of my Stream Analytics job in Azure. I need the local time instead of UTC Time. I cannot use power query to do so ( i understand that). Can you please help me, where and how can i do it !

  • @kummithavenkatareddy2302
    @kummithavenkatareddy2302 2 года назад

    Hi
    I have a problem when converting DateTime ( 11/28/2022 9:16:00 AM ) to text ( it shows 11/28/2022 9:15 )
    pls help me

  • @unnikrishnansanthosh
    @unnikrishnansanthosh 2 года назад

    Thank you Ruth, really helpful

  • @ramsjc
    @ramsjc 4 года назад

    Thank you for sharing that! You helped me a lot... first convert to UTC then to Local.. thank you!

  • @lehast
    @lehast 11 месяцев назад +1

    If what you want is to publish a report that will be seen in other parts of the world without having the user to download the report but just use it... this wont work, that column being added is populated when the data refresh is triggered, that means after you publish and a data refresh happens, it will convert to the local time zone configured at the server

    • @dandelionnnn
      @dandelionnnn 7 месяцев назад

      Did you find a way to resolve this issue?

  • @mjlacuda809
    @mjlacuda809 3 года назад

    Thanks you are awesome. You are able to fix my concern regarding timezone. Very straight forward.

  • @terrymayfield6787
    @terrymayfield6787 5 лет назад +1

    Great video! Thank you for the thoughtful example and clear explanation.

    • @CurbalEN
      @CurbalEN  5 лет назад

      My pleasure Terry, glad it was useful :)
      /Ruth

  • @bedsup
    @bedsup 8 месяцев назад

    If you create a report and add the Local Date to the report; will the time change to reflect each users time zone?. For E.g. , if a user in Australia logs in they will see it as Australian Time and if a user in New York logs in , they will see New York Time etc?

  • @ligiamoraes1223
    @ligiamoraes1223 3 года назад

    I have a similar question. I need to filter a column of the day date is today. how i can do this? I'm not finding this answer.

  • @narendrababudevarapalli6929
    @narendrababudevarapalli6929 4 года назад

    Hi Ruth, when i was publish local time zone report into services ,again it is showing UTC Time instead of local time.
    Could you please help me exactly what happens

  • @sakthiganesh7873
    @sakthiganesh7873 5 лет назад

    Ruth, How to bring a date column with milliseconds value inside powerbi?

  • @sauravsinha6939
    @sauravsinha6939 2 года назад

    I have a question i have global country name in a column and Work order created & time and wish to convert date and time from UTC to the respective country as a fixed not selectable . What to do ?

  • @faragor
    @faragor 3 года назад

    This does not work. For some reason for a week or so PBI is converting the DateTime columns automatically to our local time. But once you publish the report and refresh it once and you refresh your browser as well, everything is converted back to UTC which has no sense. Even when you do the method Ruth is showing in the video, the Time is set back to UTC. The only method I managed to change the time is to add the TimeZone offset with the TIme function to the DateTime column, which in PBI Desktop will show the wrong Time , but once it is published it shows the correct one...
    I think PBI really struggles handeling the Timezones.

  • @wilsonsun890
    @wilsonsun890 2 года назад

    Love all your videos, as a Chinese Power BI learner. One quick question: How to get local time by adding hours to Datetime format via DAX formula?

    • @kishanbhise4733
      @kishanbhise4733 2 года назад

      Measure =Now ()+(8/24) use this dax to get time in Chinese standard time..I hope this is helpful from Indian power BI learner

  • @shubhabratadey
    @shubhabratadey 11 месяцев назад

    I am referring you link but don't seem to find the pbix file. Can you please help?

  • @belizatube
    @belizatube 5 лет назад

    Always amazing tips! Tks a lot, Ruth!

    • @CurbalEN
      @CurbalEN  5 лет назад

      Thanks Rafael :)
      /Ruth

  • @nelyalvarez
    @nelyalvarez 2 года назад

    Hello Curbal - user sin a powerapp with EST regional settings are entering webinar dates/times in their local times zones and the Sharepoint list automatically updates that data in USA Eastern Time Zone. I have created a calendar view of the data in Power BI. The powerquery show the time sin UTC automatically so i just formatted that column to date/time/zone. Then I added a column for changing date from UTC to local and then another to remove the timezone. I use that last column in the calendar. All users no matter where they are now see my local time on their calendar. how can i fix that? I have researched, looked, at some many places and i am scratching my head.

  • @RodrigoSantos-mz4vs
    @RodrigoSantos-mz4vs 3 года назад

    Your tips are spectacular.
    Thank you!

    • @CurbalEN
      @CurbalEN  3 года назад +1

      Thank you!! 🥳

  • @sandhyak2817
    @sandhyak2817 3 года назад

    Hi everyone , I am trying to display user local timezone dynamically in powerbi service. User timezone must be shown as Refreshed On:. Any inputs or thoughts on this please. I am able to implement it in power bi desktop not on service.

  • @ederclebersampaiosampaio9472
    @ederclebersampaiosampaio9472 Год назад

    This is helpful!

  • @kummithavenkatareddy2302
    @kummithavenkatareddy2302 2 года назад

    A) Can we give relationship of Datetime columns? Like below in 2 tables
    ArrivalDateTime(Table1) Checkin_Start_TIme (table 2)
    10-18-2022 7:46 10-18-2022 7:46
    10-18-2022 7:45 10-18-2022 7:46
    10-18-2022 7:47 10-18-2022 7:45
    10-18-2022 7:48 10-18-2022 7:48
    10-18-2022 7:49 10-18-2022 7:49
    B) How to remove seconds part in 12 hour format ( 10/18/2022 7:46:46 PM datetime column )
    C) How to convert UTC datetime columns to Central Standard Time/Central Daylight time )
    D) How to Convert 12 hour Datetime column format to 24 hour datetime format in Power Query Editor
    E) Which visual is best for showing time calculations in Power BI.

  • @ЯнаВалериевна-ж9щ
    @ЯнаВалериевна-ж9щ 5 лет назад +1

    Thank you, had a problem with time zone, this video helped me to fix it. 🤗

  • @CJamesEnglish
    @CJamesEnglish 3 года назад +1

    This is some code I used which switches Pacific (PST or PDT) to Eastern:
    let
    Source = ... ... ... "Retrieved",
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Retrieved", type datetimezone}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Eastern Time Retrieved", each DateTimeZone.SwitchZone([Retrieved],DateTimeZone.ZoneHours([Retrieved])+3)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Retrieved"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Eastern Time Retrieved", type datetimezone}})
    in
    #"Changed Type1"

  • @adimirayhz
    @adimirayhz 4 года назад

    Great tutorial! Thanks!

  • @abbasthegreat5
    @abbasthegreat5 Год назад

    Thanks Your tutorial worked.
    By the way, It could be a 7 Mins video instead of a 15 mins video 😜

  • @kummithavenkatareddy2302
    @kummithavenkatareddy2302 2 года назад

    Excellent video , But one question here, Pls clarify me
    I have UTC datetime column which contains dates between 2020 to 2030 ( let's assume ), I have to create one custom column which is offset column for both ( Daylight Saving Time = UTC - 5 && Central Standard Time = UTC - 6 ). How to create that offset column based on UTC timestamp column.
    OR How to create directly a custom column by converting UTC timestamp column to CST and CDT timestamp

    • @berggrog1
      @berggrog1 Год назад

      Ten months later and I am dealing with the exact issue when I publish the the service, at this point just trying to hard code the hours by subtracting hours

  • @venkatareddykummitha5863
    @venkatareddykummitha5863 2 года назад

    What about the datatype in that columns.

  • @jkoenigmgm8431
    @jkoenigmgm8431 4 года назад

    how would one do this with a direct query ?

  • @thiagocurtolo6927
    @thiagocurtolo6927 4 года назад

    I would like your help Ruth.
    I have the same problem of TimeZone inside of the SharePoint list. The date and time fields, created automatcally by SharePoint when the user insert a new register, stay with the time difference between my local time and the SharePoint Server Local time and I don't have administrator rights to change the regional settings.
    I am trying to create a column that returns the current my local time.
    Well, some foruns suggest to use the column with calculated field, using the following expression:
    = Text (DateAdd (Now (); TimeZoneOffset (); Hours); "dd-mm-yyyy / hh: mm: ss")
    I've tried this and but the SharePoint return a syntax error.
    If I personalize the list form in Power Apps, the Power Apps accepts this equation, but on SharePoint not.
    Do you have some known solution?
    Thank you so much! :)

  • @nishantkumar9570
    @nishantkumar9570 Год назад

    I did but after publishing it on Power BI service it changes back to UTC by default.

  • @AlbertodaSilva1972
    @AlbertodaSilva1972 2 года назад +1

    This has an issue. Once you refresh the data in Power BI Services the converted time goes back to UTC.

  • @GeorgeBen-p7x
    @GeorgeBen-p7x 11 месяцев назад

    It worked (10:47)

  • @GustavoAlkmin
    @GustavoAlkmin 4 года назад

    Amazing Tip! Thanks!!!

  • @prateekgrover1303
    @prateekgrover1303 4 года назад

    Hi, I have followed the functionality explained in this video, But now I want to check it on my local system after changing my system's timezone but it is not reflecting the values as expected. Any suggestions ?

    • @yanzeng8038
      @yanzeng8038 3 года назад

      me either, i follow the steps, but not sure why, nothing happend

  • @rishabh7822
    @rishabh7822 3 года назад

    Hi Ruth,
    I tried this but when i published the report. Local timezone is coming as per my local. I.e. showing IST time everywhere. I want to show this time as per the user timezone who is accessing the report. Any way for that?

    • @nelyalvarez
      @nelyalvarez 2 года назад

      Hello Rishabh, were you able to solve this i have the same issue and not figured out the solution as of yet. i follow these steps but all users see my time now instead of their own time zone. if you could respond that would be amazing

  • @fabiolindoso4177
    @fabiolindoso4177 3 года назад

    You are so great! Thanks a lot for this lesson!

  • @GustavoAlkmin
    @GustavoAlkmin 4 года назад

    Just compliment my last comment and sorry to use this video to ask this, but it is somehow linked. I used this tip to convert the timezone from a 'modified date' I get from a Sharepoint file. Do you know if is possible to get not only the date, but the user inside sharepoint responsible for the modification? To get the 'modified date' I create a new query with the formula 'SharePoint.Files', but this dont retrieve the user.

    • @CurbalEN
      @CurbalEN  4 года назад

      I am not sure, But I think this video shows that?
      m.ruclips.net/video/nq-GbkrKg_c/видео.html
      /Ruth

  • @mikar636
    @mikar636 4 года назад

    Thank you so much!

  • @tirilila6666
    @tirilila6666 3 года назад

    This video helped me a lot today - thank you very much!

  • @adamwheeler1702
    @adamwheeler1702 4 года назад

    Thank you. You do a really great job at explaining this stuff!

  • @RorshackTest
    @RorshackTest 4 года назад +1

    You're cool!

  • @Pranav-fg5jr
    @Pranav-fg5jr Год назад

    This is not working on powerbi service

    • @berggrog1
      @berggrog1 Год назад

      Did you ever find a solution? at this point I am just thinking the only way to go from UTC to local on the BI Service is to remove the hours in my case - #duration(0,5,0,0)

  • @silviokrulikowski8535
    @silviokrulikowski8535 3 года назад

    thanks

  • @faryalshahabuddin9870
    @faryalshahabuddin9870 2 года назад

    Hi Ruth! I have used some of your tricks with TimeZone and relative Date but unfortunately I am not having a break through. Can you please have a look.
    Its been really more than 4 weeks, I am trying to solve this but Power BI Services is displaying the wrong data even after conversion in UTC Time Zone
    I have a report with data sources Excel Online (SharePoint Site) and Outlook Calendar.
    The following formulas are working perfectly on Desktop App and My Workspace on Power Bi Services.
    Local Time (In Power Query)
    =DateTimeZone.RemoveZone(DateTimeZone.ToLocal(DateTime.AddZone(DateTime.From([Start])+#duration(0,+14,0,0),0)))
    Relative Week (In Data-Power BI Desktop)
    = IF(DATEDIFF(TODAY(), 'EER Calendar Date Table'[Local Time],DAY) in GENERATESERIES(0, 30, 1), 1, 0)
    However, when I am publishing the report on Organisational Power BI service. It is showing the wrong data. i.e. The Decisions for Friday are showing as Thursdays and Monday's are shown as Sunday. The following image is directly form the report. Also, I have deselected in the Filter for this Visual.
    Can someone please help.
    Thanks in Advance
    Faryal.