How to convert UTC into Local Time Zone in Power BI Report using DAX?
While working on the scenario “How to refresh dataset using button in Report view of Power BI?”, We have added a DAX function UTCNOW() which will give the refresh time and date value in a card. But the value in the card will be in the UTC and we are more interested to show the value in the timezone depending upon the report user location.
For example, If report users are in India so I have to show the time in Indian standard time (+5:30 UTC). So in this article, we will see how to convert UTC to Local Time Zone using DAX in Power BI Report.
In order to convert UTC to local time zone,
1. We need to create a measure showing the Date and Time value in the UTC format.
UTC =
UTCNOW ()
If we place the measure in a card then we will get the Date and Time value as per the Universal Time Coordinated (UTC)
ITC =
FORMAT ( [UTC], “mm/dd/yyyy hh:nn:ss AMPM” ) + TIME ( 5, 30, 00 )
Format Function helps to format the UTC date and Time Data in the format provided in the function. and + TIME ( 5, 30, 00 ) add the 5 hours and 30 minutes to the UTC time in order to convert to the IST time zone.
So let`s see the result of the IST measure created.
Conversion of the time zone is a very practical requirement that is used very frequently. Even though there are other methods as well through the power query but I found this method very easy to implement.
Please do let me know your thoughts and if you like the article please share with your friends on Linkedin.
It says FORMAT is not a function
Format is a dax function. I did not get your question where it is mentioned that format is not a function. Can you please explain a little more about your problem?
This looks like a format issue. I used this: FORMAT ( UTCNOW() – TIME ( 7, 00, 00 ), "mm/dd/yyyy hh:nn:ss " )