web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get all days from date...
Power Apps
Unanswered

Get all days from date interval

(0) ShareShare
ReportReport
Posted on by 259

Hi Guys, So I am currently working a vacation app through power apps and power automate.

I have a start and end date on powerapps, and when the users submits this dates It goes to the flow and inserts the data into a sharepoint table.

My main issue is,compare the date inserted with the dates that are allready there inserted by other users.

My question is, given a start/end date how can I get all the days between these two dates.

 

Scenario example:

Marcus registers vacation from 20/03/2022 to 30/03/2022 

Edward registers vacation from 24/03/2022 to 28/03/2022 

 

Thanks in advance.

Categories:
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @JoaoSantos489 ,

     

    Can you try the below code and verify,

    //For Marcus,
    DateDiff( DateValue("03/20/2022"), DateValue("03/30/2022") )
    
    //For Edward,
    DateDiff( DateValue("03/24/2022"), DateValue("03/28/2022") )

     

    Hope this helps

  • JoaoSantos489 Profile Picture
    259 on at

    Hi @Ethan_R thanks for your answer.

     

    Unfortunately it doesnt help me, DateDiff() will return me the number of days between the two dates.

    I am trying to find some function/procedure/something that returns the days in full. So i can see that user Edward has marked vacation  in the same period as Marcus.

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @JoaoSantos489 ,

     

    There might be better solution,

    I found a way which is,

     

    With(
     {
     Marcus_StartDate: DateValue("03/20/2022"),
     Marcus_EndDate: DateValue("03/30/2022"),
     Edward_StartDate: DateValue("03/24/2022"),
     Edward_EndDate: DateValue("03/28/2022")
     },
     If(
     ((Edward_EndDate - Marcus_StartDate) > 0 && (Edward_EndDate - Marcus_EndDate) > 0)
     ||
     ((Edward_EndDate - Marcus_StartDate) < 0 && (Edward_EndDate - Marcus_EndDate) < 0)
     &&
     ((Edward_StartDate - Marcus_StartDate) > 0 && (Edward_StartDate - Marcus_EndDate) > 0)
     ||
     ((Edward_StartDate - Marcus_StartDate) < 0 && (Edward_StartDate - Marcus_EndDate) < 0),
     "Edward holiday doesn't fall under Marcus's Holiday",
     "Edward marked Holiday in the time frame of Marcus"
     )
    )

     

     

    So in this case, I'm check whether Edward's Start Date is not in within Marcus Holiday Range and Edward's End Date is not in within Marcus Holiday Range.

    Below is the visual of the values we get,

    Ethan_R_0-1647625469231.png

     

    As you see, If date lies within range, we get alternate signs +ve and -ve, else if date doesn't lie in range either both is +ve or -ve

     

     

    Hope this helps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard