How to convert UTC into Local Time Zone in Power BI Report using DAX?

Table of Contents

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)

2. We need to convert the UTC time zone format to the IST time zone as our users are located in India.
In order to convert we need to create a measure IST using below mentioned DAX Code.

ITC =
FORMAT ( [UTC], “mm/dd/yyyy hh:nn:ss AMPM” ) + TIME ( 53000 )

Format Function helps to format the UTC date and Time Data in the format provided in the function. and + TIME ( 53000 ) 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.

Final Thoughts

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.

Categories
WHAT IS AVAILABILITY SET & AVAILABILITY ZONE
Azure
Kaushlendra Mishra

What is Availability Set and Availability Zone in Azure?

What is Availability Set and Availability Zone in Azure? In Availability Set, VM`s copy is created and is isolated with separate physical servers, computer racks, storage units, network switches in a data center within a region so if one of the VM stops working then still we have the copy of the VM working within the same datacenter. While Availability Zone ensures that complete datacenter data is replicated to another place at a distance within the same region so that even if complete data center fails due to any reason then also Availability of data is ensured.

Read More »
prepare-DP-200-exam
Azure
Kaushlendra Mishra

How to Prepare for DP-200 Exam?

I have passed the DP-200 exam on 28 Oct 2020. I have gone through the various study material and courses in order to prepare for the exam. Overall, the time taken by me for the DP-200 exam is approx 3 months. Ideally, you should not take 3 months of time but due to lack of guidance, I happen to take a number of online courses which was not required to be taken for passing the DP-200 Exam.

Read More »

3 thoughts on “How to convert UTC into Local Time Zone in Power BI Report using DAX?”

Leave a Comment

Your email address will not be published. Required fields are marked *