Forum Discussion
Missing latest date using List.Min and List.Max
Anonymous
Add + 1 to your duration,
= Duration.Days(Duration.From(EndDate - StartDate ))+ 1
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
I just encountered the same problem again, and this solution worked again.
Fowmy , what is it about the Duration.Days function that requires +1? Why won't this work without +1?
- Fowmy5 years ago
Super User
Anonymous
By adding +1, you ensure that all days between the dates are included.
If StartDate = 1/1/2020 and EndDate = 1/5/2020 then you need the results inclusive of both dates which is 5.________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
- Anonymous5 years agoNot applicable
Fowmy Got it. So in M, the function Start Date - End Date is not inclusive, and +1 makes it so. Thanks!