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 / Collect all dates betw...
Power Apps
Answered

Collect all dates between start and end date

(1) ShareShare
ReportReport
Posted on by 23

Hi Experts 

I'm building an app where i will like to get a complete collection of days a person i working on a project. 

I have a collection of people, start and end date and the project. 

 

I will like to make a collection with: 

Date Name Project

One item for every day. 

 

I will then make a gallery with all people, and dates and the color in dates people are on projects just be doing a lookup on name and date in the new collection. 

 

I can't make the loop that will make an item between dates to work, can someone help me on this matter? 

 

People data

ClearCollect(
 PersonSchedule,
 { ProjectName: "Project A", Person: "John Doe", StartDate: DateValue("2024-07-01"), EndDate: DateValue("2024-03-10") },
 { ProjectName: "Project B", Person: "Jane Smith", StartDate: DateValue("2024-07-03"), EndDate: DateValue("2024-07-05") },
 { ProjectName: "Project C", Person: "Michael Brown", StartDate: DateValue("2024-07-05"), EndDate: DateValue("2024-07-18") },
 { ProjectName: "Project D", Person: "Sarah Johnson", StartDate: DateValue("2024-07-07"), EndDate: DateValue("2024-07-20") },
 { ProjectName: "Project E", Person: "David Lee", StartDate: DateValue("2024-07-09"), EndDate: DateValue("2024-07-22") },
 { ProjectName: "Project F", Person: "Emily Davis", StartDate: DateValue("2024-07-11"), EndDate: DateValue("2024-07-25") }
)

 

Result 

DateNameProject
2024-07-01John DoeProject A
2024-07-02John DoeProject A
2024-07-03John DoeProject A
2024-07-03Jane SmithProject B
2024-07-04Jane SmithProject B
2024-07-05Jane SmithProject B

And so on. 

 

This will make it quit simple to work with, maybe not the smartest way, but quit sure it will work. 

 

Br

SSJ

Categories:
I have the same question (0)
  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Hey @SSJDK ,

     

    Can you try something like this? 

    ForAll(Sequence(DateDiff(StartDate,EndDate),
    Collect(PersonSchedule;{ProjectName:"Project A", Person:"John Doe"; Date: StartDate+ThisRecord.Value}))

     

    Let me know if it helped you.

     

  • Verified answer
    WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    HI @SSJDK ,

    This is made much harder with the different date ranges

    Clear(colSummary);
    ForAll(
     PersonSchedule As _Data,
     ForAll(
     Sequence(
     DateDiff(
     _Data.StartDate,
     _Data.EndDate,
     TimeUnit.Days
     ) + 1
     ),
     Collect(
     colSummary,
     {
     ProjectName: _Data.ProjectName,
     Person: _Data.Person,
     Date: DateAdd(
     _Data.StartDate,
     Value - 1,
     TimeUnit.Days
     )
     }
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • SSJDK Profile Picture
    23 on at

    WOW That did exactly what i want it to do! I bit slow (not you), but i works! 😄 

     

    Huge tanks! 

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard