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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collect all dates betw...
Power Apps
Unanswered

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,099 Super User 2025 Season 2 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
    153,026 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard