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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
akhaliq7
Post Prodigy
Post Prodigy

Get duration from two date columns

Need help to find the duration in days between two date fields.

 

Table[Date1], Table[Date2]

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use following

= Duration.TotalDays([Date2]-[Date1])

View solution in original post

2 REPLIES 2
ShirinArshadnia
Helper II
Helper II

@akhaliq7 

You can use datediff in sql or this Dax measure:

Measure =
DATEDIFF(<Date1>, <Date2>, <Interval>)

also this may help you :


EVALUATE VAR StartDate = DATE ( 2019, 07, 01 ) VAR EndDate = DATE ( 2021, 12, 31 ) RETURN { ( "Year", DATEDIFF ( StartDate, EndDate, YEAR ) ), ( "Quarter", DATEDIFF ( StartDate, EndDate, QUARTER ) ), ( "Month", DATEDIFF ( StartDate, EndDate, MONTH ) ), ( "Week", DATEDIFF ( StartDate, EndDate, WEEK ) ), ( "Day", DATEDIFF ( StartDate, EndDate, DAY ) ) }
Vijay_A_Verma
Super User
Super User

Use following

= Duration.TotalDays([Date2]-[Date1])

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors