Dax Function: NOW
Category: Date and Time Functions
The NOW function in Power BI returns the current date and time as a datetime value.
Purpose
To dynamically retrieve the exact system date and time during data refresh or query evaluation.
Type of Calculations
Date and time-based calculations with real-time updates.
Practical Use Cases
- Tracking data refresh timestamps.
- Calculating the time elapsed between events and the current moment.
- Filtering or slicing data based on real-time or dynamic periods.
NOW()
Parameter | Type | Description |
---|---|---|
None | The function does not take any parameters. |
How Does NOW Dax Function Works
- The NOW function retrieves the system’s current date and time during the execution of a DAX query or report refresh.
- The value updates dynamically in calculated columns or measures when the model is refreshed or when a query is re-executed.
What Does It Return?
- Type: Datetime.
- Meaning: Returns a datetime value representing the current date and time from the system clock.
When Should We Use It?
- Dynamic Reporting: When reports or dashboards need to show real-time or current status, such as “Last Updated” timestamps.
- Elapsed Time Calculations: For calculating durations between the current time and specific events (e.g., project deadlines).
- Date Filtering: To filter data dynamically using relative date/time periods (e.g., “Last 7 Days”).
Examples
Basic Usage
Retrieve the current date and time:
CurrentDateTime = NOW()
Output: If the current system time is 2025-02-10 14:30:00
, the result will return this exact value.
Column Usage:
Create a calculated column to find the time difference between each event and now:
ElapsedTime = NOW() - Table[EventDateTime]
Output: Returns the difference in days (including fractional days for time differences).
Advanced Usage
Combine the NOW function with other DAX functions for conditional logic:
IsOverdue = IF(Table[DueDate] < NOW(), "Yes", "No")
Output: Marks tasks as overdue if their DueDate
is earlier than the current date and time.
Tips and Tricks
- Use NOW sparingly in calculated columns to avoid performance issues in large datasets, as it requires recalculation upon refresh.
- For date-only values, use TODAY instead, which excludes the time component.
- Combine with formatting functions like FORMAT to customize the appearance of the datetime value.
Potential Pitfalls
- Frequent Updates: The value returned by NOW changes dynamically during every refresh, so it may not be suitable for static or archived reports.
- Timezone Dependency: Ensure consistency in time zones across different systems to avoid mismatched timestamps.
Performance Impact of NOW DAX Function:
- Avoid excessive use in calculated columns to minimize recalculations and ensure optimal performance.
- Use measures instead of calculated columns for dynamic but lightweight calculations.
Related Functions You Might Need
- TODAY: Returns only the current date without the time component.
- DATE: Creates a datetime value using specific year, month, and day inputs.
- NOW in Power Query: Provides a similar function for Power Query transformations.
- UTCNOW: Returns the current date and time in Coordinated Universal Time (UTC).
Want to Learn More?
For more information, check out the official Microsoft documentation for NOW 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.
The NOW function returns the current system date and time as a datetime value.
The NOW function includes both date and time, whereas TODAY returns only the date without the time component.
Yes, it updates dynamically during data refresh or query execution.
Yes, it is commonly used to show the last updated timestamp in reports.
The function depends on the system clock of the machine running the query or refresh, so ensure timezone consistency.
Established in 2020, Lets Viz Technologies provides a full range of high-quality data analysis and data visualization services. We are also an authorized Zoho Partner.
Sitelinks