How can I calculate the number of days between a specific date and today in Power BI?

To calculate the number of days between a specific date and today in Power BI, you can use the DATEDIFF function. This function allows you to specify the start and end dates and returns the difference in days. Simply input the specific date and today’s date as the parameters, and the function will calculate the number of days between them. This can be useful for tracking time intervals and analyzing data trends in a visual and efficient manner in the Power BI platform.

Power BI: Calculate Days Between Date and Today


You can use the following syntax in DAX to calculate the number of days between a date and today in Power BI:

Difference = DATEDIFF('my_data'[Date], TODAY(), DAY)

This particular example creates a new column named Difference that contains the number of days between the date in the Date column of a table named my_data and today’s date.

The following example shows how to use this syntax in practice.

Example: How to Calculate Days Between Date and Today in Power BI

Suppose we have the following table in Power BI named my_data that contains information about the total sales made on various dates at some company:

This article is being written on 1/8/2024.

Suppose that we would like to create a new column that contains the number of days between the dates in the Date column and today’s date.

To do so, click the Table tools tab and then click the New column icon:

Then type the following formula into the formula bar:

Difference = DATEDIFF('my_data'[Date], TODAY(), DAY)

This will create a new column named Difference that contains the number of days between the dates in the Date column and today’s date of 1/8/2024:

Power BI calculate days between date and today

From the output we can see:

  • There are 737 days between 1/1/2022 and today’s date of 1/8/2024.
  • There are 604 days between 5/14/2022 and today’s date of 1/8/2024.
  • There are 568 days between 6/19/2022 and today’s date of 1/8/2024.

Note: You can find the complete documentation for the DATEDIFF function in DAX .

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:

x