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.
Hi fellows,
I am using this code in Power query
= #table(type table[LastRefresh=text], {{DateTime.ToText(DateTime.From(DateTimeZone.UtcNow()), [Format="dd.MM.yyyy HH:mm:ss"])&" (UTC)"}})
to show to clients in card, when their report was refreshed last time in UTC time. It works all right in service, but in Desktop it shows not UTC time but CEST time. How is it possible? Thanks for help.
Solved! Go to Solution.
Hi, @RadkaProefo
This is because Power BI Desktop uses your computer’s local time, whereas Power BI Service uses UTC time. This can cause a plethora of problems with reporting the correct date, functions choosing current day, etc. Below are 2 possible methods to get around this issue.
Method 1: DAX Measures
Probably the easiest method to use is by simply adding or subtracting the difference of your time zone and UTC time from the DAX NOW() function.
This method is very easy to put together, simply Google your time zone offset or look it up on a site like below. Then, add or subtract the total from the now function, and you have your proper time in Power BI Service.
It is worth noting however, that this method a notable downside. In Power BI Desktop, your time will appear as the computer’s time +/- your offset, rather than UTC +/- the offset, this may make it difficult to test some reporting elements, as they will appear differently in Desktop and Service.
Method 2: Power Query
Power Query has inbuilt functions to deal with this issue, namely the DateTimeZone functions. Using the SwitchZone function, it is easy to select your preferred time zone via the method below. As before you can see the -8 offset for PST from UTC (note the 0 in the optional minutes offset, which can be left blank in many cases). If you have data that needs visibility to your DateTime information within Power Query, this method may work best.
For reference:
Dynamic time zone conversion using Power BI – The White Pages (tygraph.com)
Auto date/time in Power BI Desktop - Power BI | Microsoft Docs
DateTimeZone functions - PowerQuery M | Microsoft Docs
Solved: UTC to Local time in Power BI Service with DayLigh... - Microsoft Power BI Community
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @RadkaProefo
This is because Power BI Desktop uses your computer’s local time, whereas Power BI Service uses UTC time. This can cause a plethora of problems with reporting the correct date, functions choosing current day, etc. Below are 2 possible methods to get around this issue.
Method 1: DAX Measures
Probably the easiest method to use is by simply adding or subtracting the difference of your time zone and UTC time from the DAX NOW() function.
This method is very easy to put together, simply Google your time zone offset or look it up on a site like below. Then, add or subtract the total from the now function, and you have your proper time in Power BI Service.
It is worth noting however, that this method a notable downside. In Power BI Desktop, your time will appear as the computer’s time +/- your offset, rather than UTC +/- the offset, this may make it difficult to test some reporting elements, as they will appear differently in Desktop and Service.
Method 2: Power Query
Power Query has inbuilt functions to deal with this issue, namely the DateTimeZone functions. Using the SwitchZone function, it is easy to select your preferred time zone via the method below. As before you can see the -8 offset for PST from UTC (note the 0 in the optional minutes offset, which can be left blank in many cases). If you have data that needs visibility to your DateTime information within Power Query, this method may work best.
For reference:
Dynamic time zone conversion using Power BI – The White Pages (tygraph.com)
Auto date/time in Power BI Desktop - Power BI | Microsoft Docs
DateTimeZone functions - PowerQuery M | Microsoft Docs
Solved: UTC to Local time in Power BI Service with DayLigh... - Microsoft Power BI Community
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
And how is it with winter and summer? Because it is 1 or 2 hours to switch?
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |