Dax Function: TODAY
Category: Date and Time Functions
The TODAY function in Power BI is a DAX function that returns the current date (without the time portion) based on the system clock of the machine running the Power BI service or desktop.
Purpose
To dynamically fetch the current date for use in calculations or reports.
Type of Calculations
It generates a date value that updates automatically whenever the data model is refreshed.
Practical Use Cases
- Calculating the age of records or durations.
- Filtering reports or dashboards to show data relative to the current date.
- Automatically updating key performance indicators (KPIs) that depend on today’s date.
TODAY()
| Parameter | Type | Description |
|---|---|---|
| (None) | N/A | The function does not take any parameters. |
How Does TODAY Dax Function Works
The TODAY function retrieves the current date from the system clock. It updates whenever the data model is refreshed in Power BI. This function can be used in measures, calculated columns, or filters.
Behavior:
- In measures: The value updates dynamically when the report is refreshed.
- In calculated columns: The value is static and updates only when the table is refreshed or recalculated.
What Does It Return?
- Type: Date.
- Meaning: Returns the current date as a
Datedata type. The time portion is always set to 12:00 AM (midnight).
When Should We Use It?
- Dynamic Reports: Use in reports that require real-time date context, such as showing “Today’s Sales” or “Upcoming Deadlines.”
- Time-Based Calculations: Calculating age, durations, or determining if dates are in the past, present, or future.
- Filters: Creating date filters that always reference the current date, such as “Show data from the last 7 days.”
Examples
Basic Usage
Create a measure to display today’s date:
TodayDate = TODAY()
Output: The current date, such as 2025-02-10.
Column Usage:
Create a calculated column to determine if a date is in the past:
IsPastDate = IF(Table[Date] < TODAY(), "Past", "Future or Today")
Output: Returns “Past” for rows where Table[Date] is before today.
Advanced Usage
Calculate the age of a person based on their birthdate:
Age = DATEDIFF(Table[BirthDate], TODAY(), YEAR)
Output: Returns the person’s age in years.
Tips and Tricks
- Refresh Dependency: Remember that TODAY updates only when the data model is refreshed, not continuously.
- Static Dates: For static calculations, use a manually entered date instead of TODAY.
- Formatting: Use Power BI’s formatting options to display the date in the desired format (e.g.,
MM/DD/YYYYorDD-MMM-YYYY). - Combine with Other Functions: Pair TODAY with DAX functions like
DATEDIFF,IF, orCALCULATEfor advanced calculations.
Potential Pitfalls
- Time Zone Differences: The value depends on the system clock, which may differ across servers or regions.
- Performance Impact: In large datasets, using TODAY in calculated columns may increase processing time.
- Refresh Dependency: The function doesn’t update dynamically in real-time; it requires a data refresh.
Performance Impact of TODAY DAX Function:
- Use measures with TODAY rather than calculated columns when working with large datasets to improve performance.
- Cache calculations when possible to minimize computation overhead.
Related Functions You Might Need
- NOW: Returns the current date and time.
- DATE: Constructs a date from individual year, month, and day values.
- DATEDIFF: Calculates the difference between two dates.
- YEAR, MONTH, DAY: Extract components of a date.
Want to Learn More?
For more information, check out the official Microsoft documentation for TODAY 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.
It returns the current date as a Date data type without the time component.
It updates whenever the data model is refreshed in Power BI.
Yes, but the value will not dynamically update unless the dataset is refreshed.
No, it depends on the system clock of the machine running the Power BI service or desktop.
Use the formula DATEDIFF(BirthDate, TODAY(), YEAR) to calculate age in years.