UTCNOW

How to Use the Power BI DAX function UTCNOW

What is UTCNOW Function?

Before we dive into the details, let’s briefly explain what UTCNOW function is and what it does. UTCNOW is a DAX function that returns the current date and time in Coordinated Universal Time (UTC) format. UTC is a standard time format used worldwide, which is based on the time at the Prime Meridian (0° longitude). The UTCNOW function has a very simple syntax:


UTCNOW()


When you call this function, it returns the current date and time in UTC format. For example, if the current date and time is May 25th, 2022 10:30 AM Pacific Time (UTC-7), the UTCNOW function would return May 25th, 2022 5:30 PM UTC.

How to Use UTCNOW Function?

Now that we know what UTCNOW function does, let's explore how to use it in Power BI. There are several scenarios where you might need to use UTCNOW function, such as:

1. Time zone conversion

If you are working with data that is recorded in different time zones, you might need to convert the date and time values into a common time zone for analysis and reporting purposes. UTC is a common time zone that is used as a reference point for time zone conversions. By using the UTCNOW function, you can get the current date and time in UTC format, which you can then use to convert the date and time values recorded in other time zones.

For example, let's say you have a sales report that includes order dates recorded in different time zones, such as Pacific Time, Eastern Time, and Central Time. You want to convert all the order dates into UTC format, so that you can analyze the data consistently. Here's how you can do it:

1. Create a new column in your dataset, and name it "Order Date UTC".

2. In the formula bar, type the following formula:


Order Date UTC = CONVERT([Order Date], “UTC”, “Pacific Standard Time”)


This formula converts the date and time value in the "Order Date" column from Pacific Time to UTC format, using the UTCNOW function as the reference point. You can replace "Pacific Standard Time" with any other time zone, depending on your data.

3. Press Enter to apply the formula to the new column. The new column will display the order dates in UTC format.

2. Time-based calculations

Another scenario where the UTCNOW function can be useful is when you need to perform time-based calculations, such as calculating the time difference between two dates or calculating the age of a person based on their birthdate. By using the UTCNOW function, you can get the current date and time in UTC format, which you can then use as a reference point for your calculations.

For example, let's say you have a dataset that includes employee birthdates, and you want to calculate the age of each employee. Here's how you can do it:

1. Create a new column in your dataset, and name it "Age".

2. In the formula bar, type the following formula:


Age = YEAR(UTCNOW()) – YEAR([Birthdate])


This formula calculates the age of each employee by subtracting their birth year from the current year, using the UTCNOW function as the reference point. You can replace "Birthdate" with the name of the column that contains the birthdates.

3. Press Enter to apply the formula to the new column. The new column will display the age of each employee.

In conclusion, the UTCNOW function is a powerful tool that can help you work with date and time values in Power BI. By using this function, you can convert time zones, perform time-based calculations, and much more. We hope this article has provided you with a better understanding of how to use the UTCNOW function to enhance your reporting and analysis capabilities in Power BI.

Power BI DAX Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)