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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

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,586)