Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello all,
I tried multiple functions to change the time from UTC to my local time, but its not working
as you can see above in colomnm [EVENT_TIME_UTC], I have the time in UTC and my local time is UTC+3 (Saudi Arabia)
The functions I tried have worked, but it doesnt give me changed time, it only adds +3 in the end.
I need a funtion that changes the time itself.
Thank you.
Solved! Go to Solution.
HI @Anonymous
Download this sample PBIX file with the following data and measure
Create a Calculated Column using this
EVENT_TIME_LOCAL = 'Table'[EVENT_TIME_UTC] + TIME(3,0,0)
Giving this result
Regards
Phil
Proud to be a Super User!
HI @Anonymous
Download this sample PBIX file with the following data and measure
Create a Calculated Column using this
EVENT_TIME_LOCAL = 'Table'[EVENT_TIME_UTC] + TIME(3,0,0)
Giving this result
Regards
Phil
Proud to be a Super User!
@Anonymous You can do it in the powerquery window, open your data in the powerquery window and then add a custom column
use the below code in the custom colum
= Table.AddColumn(#"Changed Type", "Custom", each DateTime.AddZone([Time in UTC],2,30))
then change the data type of the new column to Date/Time like below
you are done. let me know if you face any trouble
Proud to be a Super User!
Hello @Anonymous
Are you trying to do the datetime transformation using Power Query or DAX?
Have you tried using the DateTime.AddZone and DateTimeZone.SwitchZone functions in Power Query?
https://docs.microsoft.com/en-us/powerquery-m/datetime-addzone
https://docs.microsoft.com/en-us/powerquery-m/datetimezone-switchzone
https://www.poweredsolutions.co/2019/10/21/handling-different-time-zones-in-power-bi-power-query/
Example in Power Query:
DateTimeZone.ToLocal(DateTime.AddZone([date_created_UTC],3))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |