Dax Function: UTCNOW

Category: Date and Time Functions

The UTCNOW function in Power BI is a DAX function that retrieves the current date and time in Coordinated Universal Time (UTC).

Purpose

To provide a universal timestamp, unaffected by local time zones, for use in global datasets and calculations.

Type of Calculations

It generates a DateTime value that reflects the current UTC time.

Practical Use Cases

  • Standardizing timestamps in reports across different time zones.
  • Calculating time differences in a globally distributed dataset.
  • Creating time-based KPIs that require a consistent reference frame.

UTCNOW()

ParameterTypeDescription
(None)N/AThe function does not take any parameters.

How Does UTCNOW Dax Function Works

The UTCNOW function reads the system clock of the machine running Power BI Desktop or the Power BI service and converts the local time into UTC time. It is dynamically evaluated, meaning the value changes depending on when the data model is refreshed.

Key Characteristics:

  • Reflects the exact moment the model refresh occurs.
  • Returns a DateTime value that can be used directly in calculations, visuals, and filters.

What Does It Return?

  • Type: DateTime.
  • Meaning: Returns the current date and time as a DateTime data type in UTC format.

When Should We Use It?

  • Global Reporting: For organizations with data spread across multiple time zones to maintain consistency in reporting.
  • Timestamp Standardization: When working with logs or events captured in different local times.
  • Dynamic Calculations: To track events relative to a universal timeline, such as SLA tracking.

Examples

Basic Usage

Create a measure to display the current UTC date and time:


CurrentUTCDateTime = UTCNOW()

Output: Returns a value like 2025-02-10 15:32:45.

Column Usage:

Add a calculated column to show if a timestamp is in the past relative to the current UTC time:


IsPastUTC = IF(Table[Timestamp] < UTCNOW(), "Past", "Future")

Output: Categorizes rows as “Past” or “Future” based on their timestamp.

Advanced Usage

Combine with other functions to calculate the time difference between a local timestamp and UTC:


TimeDifferenceInHours = DATEDIFF(Table[LocalTimestamp], UTCNOW(), HOUR)

Output: Calculates the time difference in hours.

Tips and Tricks

  • Standardization: Use UTCNOW for global datasets to avoid inconsistencies caused by time zones or daylight saving time.
  • Refresh Dependency: Like other dynamic DAX functions, UTCNOW updates only during model refreshes.
  • Conversion: Combine UTCNOW with TIMEZONEOFFSET or other time zone-related calculations to derive local times.
  • Use in Measures: For real-time calculations, prefer measures over calculated columns for better performance.

Potential Pitfalls

  • Time Zone Assumptions: UTCNOW does not adjust to local time zones; ensure you’re aware of this when working with localized datasets.
  • Refresh Frequency: The value is static between data model refreshes, which may not reflect real-time changes.
  • Performance: Using UTCNOW in calculated columns for large datasets may increase processing times.

Performance Impact of UTCNOW DAX Function:

  • Avoid heavy use of UTCNOW in calculated columns in large datasets. Instead, use measures for dynamic calculations.
  • Cache static calculations that use UTCNOW to minimize processing overhead during refreshes.

Related Functions You Might Need

  • NOW: Returns the current date and time in the local time zone.
  • TODAY: Returns the current date without the time component.
  • DATEDIFF: Calculates the difference between two dates or times.
  • TIMEZONEOFFSET: Calculates the offset between the UTC and local time zone.

Want to Learn More?
For more information, check out the official Microsoft documentation for UTCNOW You can also experiment with this function in your Power BI reports to explore its capabilities.

Unlock the full capabilities of Power BI and elevate your data insights with our specialized consulting services. Whether you need guidance on advanced DAX functions like those highlighted here, support in designing interactive dashboards, or expertise in optimizing data models for enhanced performance, our experienced Power BI consultants are equipped to deliver customized solutions for your business. Explore our Power BI Consulting Services page to discover how we can help your organization make smarter, data-driven decisions.

1. What does the UTCNOW function in Power BI return?

It returns the current date and time in UTC format as a DateTime data type.

2. How often does UTCNOW update?

UTCNOW updates only when the data model is refreshed in Power BI.

3. Can I convert UTCNOW to a local time zone?

Yes, you can use functions like TIMEZONEOFFSET or custom calculations to convert UTC to a specific local time zone.

4. Is UTCNOW affected by daylight saving time?

No, UTCNOW is not affected by daylight saving time, as it always returns time in UTC.

5. How can I calculate the time difference between UTCNOW and another timestamp?

Use the DATEDIFF function with UTCNOW and the other timestamp to calculate the difference.