Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to calculate period days from Created Date to Current/Today Date

Hi,

 

How to calculate period day betwen two date.

First Date is Created Date

Second Date is TODAY date.

 

Thanks

2 ACCEPTED SOLUTIONS
TomMartens
Super User
Super User

If you want to use DAX to create a calculated column, you can use this formula

Measure = DATEDIFF("2017-03-20", TODAY(), DAY)

This Formula returns the difference from the 20th of March 2017 until today in days. I used a constant for the StartDate. You have to replace "2017-03-20" by 'your tablename'[your columnname] to reference a column in on one of your tables.

 

Hope this helps



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

hweaves12
Frequent Visitor

Is it possible your dates are in different formats? ie DD/MM/YYYY versus MM/DD/YYYY

 

The dax formula submitted already is right.

 

DATEDIFF(MyTable[Start Date], MyTable[End Date], DAY) for number of days

DATEDIFF(MyTable[Start Date], MyTable[End Date], YEAR) for number of years

View solution in original post

3 REPLIES 3
hweaves12
Frequent Visitor

Is it possible your dates are in different formats? ie DD/MM/YYYY versus MM/DD/YYYY

 

The dax formula submitted already is right.

 

DATEDIFF(MyTable[Start Date], MyTable[End Date], DAY) for number of days

DATEDIFF(MyTable[Start Date], MyTable[End Date], YEAR) for number of years

TomMartens
Super User
Super User

If you want to use DAX to create a calculated column, you can use this formula

Measure = DATEDIFF("2017-03-20", TODAY(), DAY)

This Formula returns the difference from the 20th of March 2017 until today in days. I used a constant for the StartDate. You have to replace "2017-03-20" by 'your tablename'[your columnname] to reference a column in on one of your tables.

 

Hope this helps



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hi @TomMartens,

 

Its doest work for me. The error state the start date cannot be grater than the end date althougt created date is lower than TODAY date.

 

Thanks

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors