Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
81 | |
53 | |
37 | |
37 |