cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Calculate no.of days from two different dates

Hi All,

 

How to Calculate no.of days from two different dates. (e.g 2019-07-13 and 2020-01-10) There is the year changed.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Calculate no.of days from two different dates

Hi,

 

Please try to create three calculated columns:

Year difference = DATEDIFF('Table'[DateStart],'Table'[DateEnd],YEAR)
Month difference = DATEDIFF('Table'[DateStart],'Table'[DateEnd],MONTH)
Day difference = DATEDIFF('Table'[DateStart],'Table'[DateEnd],DAY)

And the result shows:

11.PNG

 

Best Regards,

Giotto Zhi

View solution in original post

5 REPLIES 5
Highlighted
Super User I
Super User I

Re: Calculate no.of days from two different dates

Hi,

 

Try using DATEDIFF

Column = DATEDIFF('Table'[Startdate],'Table'[Enddate],DAY)
Highlighted
Super User IV
Super User IV

Re: Calculate no.of days from two different dates

datediff(date1,date2,days)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper II
Helper II

Re: Calculate no.of days from two different dates

I tried it but shown only difference from the days but there is a year and the month is different.

 

Highlighted
Super User IV
Super User IV

Re: Calculate no.of days from two different dates

datediff(date1,date2,month)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: Calculate no.of days from two different dates

Hi,

 

Please try to create three calculated columns:

Year difference = DATEDIFF('Table'[DateStart],'Table'[DateEnd],YEAR)
Month difference = DATEDIFF('Table'[DateStart],'Table'[DateEnd],MONTH)
Day difference = DATEDIFF('Table'[DateStart],'Table'[DateEnd],DAY)

And the result shows:

11.PNG

 

Best Regards,

Giotto Zhi

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors