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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Sdhn420
Helper IV
Helper IV

Number of Days between two Date Measures

Hi,

 

I have two measures with calculated date values. 

Measure 1: 

Pre_Joining_Completed = CALCULATE(MAX(Category_Combined[Date_Value]),Category_Combined[Category]="Pre-Joining")
 
Measure 2:
Checklist_Created = MIN(Emp_Benefits[Created])

 

How can i create another measure to find number of days between them?

2 ACCEPTED SOLUTIONS
TomMartens
Super User
Super User

Hey @Sdhn420 ,

 

returning the number of days between two dates is quite straight forward, as dates are stored as decimals internally. For this reason the below sample returns 15, you might have to consider adding 1 if you want to count the start date as well.

 

Days between dates = 
var measure1 = DATE( 2021 , 6 , 2 )
var measure2 = DATE( 2021 , 6 , 17 )
return
INT( measure2 - measure1 )

Hopefully, this provides what you are looking for.

 

Regards,

Tom



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

Thank you so much! This is exactly what I was looking for! 

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey @Sdhn420 ,

 

returning the number of days between two dates is quite straight forward, as dates are stored as decimals internally. For this reason the below sample returns 15, you might have to consider adding 1 if you want to count the start date as well.

 

Days between dates = 
var measure1 = DATE( 2021 , 6 , 2 )
var measure2 = DATE( 2021 , 6 , 17 )
return
INT( measure2 - measure1 )

Hopefully, this provides what you are looking for.

 

Regards,

Tom



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

Thank you so much! This is exactly what I was looking for! 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors