cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChristosKarak
Frequent Visitor

Get difference between Dates

Greetings,

 

I'm new to PowerApps and i want to calculate the difference between two Dates. I have an app, where a field show the Departure Date and another field the Return Date. I want the difference to be shown in another field tempsdaystaken. I have tried the below DateDiff function, it returns no errors, but it doesn't show anything.

 

DateDiff(ThisItem.'Return Date',ThisItem.'Departure Date',Days)

ChristosKarak_0-1608216653017.png

 

Kind regards and thanks in advance,

Chris

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @ChristosKarak ,

 

How about using:

DateDiff(DateCardValue3.SelectedDate,DateCardValue4.SelectedDate,Days)

 

You are trying to use ThisItem.'Return Date' and ThisItem.'Departure Date' as there are empty values on a new mode form.

 

Hope it helps !

View solution in original post

4 REPLIES 4
rebeccas
Community Champion
Community Champion

It is just blank? Doesn't show 0 or anything in your label? 

 

I know this might sound silly but I have had it happen. Make sure your label is visible, not covered by anything and has a text color that will show. If there is no error it should show something.

Hello, thanks for your answer. Yes, visible is on and the text color is like the other fields, if it was correct, it should show something. 

 

ChristosKarak_0-1608275260605.png

 

Hi @ChristosKarak ,

 

How about using:

DateDiff(DateCardValue3.SelectedDate,DateCardValue4.SelectedDate,Days)

 

You are trying to use ThisItem.'Return Date' and ThisItem.'Departure Date' as there are empty values on a new mode form.

 

Hope it helps !

View solution in original post

Thank you very much, that solved my problem!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,075)