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 / Expanding records for ...
Power Apps
Answered

Expanding records for week with week number b/w start, end date and group, sum by Week number

(0) ShareShare
ReportReport
Posted on by 36

I have records for Tasks in Sharepoint List with columns TaskName, StartDate, EndDate, Effort%

I want to generate collection with 1 record for each week with week number b/w start, end date and group, sum by Week number.

 

Example input and output.

 

Data source

TaskName StartDate EndDateEffort%
T1 8 Jan 2024 27 Jan 202445
T2 1 Jan 2024 20 Jan 202420

 

 

Output Collection

WeekNumEffort%
120
265
365
445



Categories:
  • Verified answer
    microsoftee Profile Picture
    36 on at

    ClearCollect(taskEffort,
    {TaskName:"P1", Week:2, Effort:50}
    );

    Clear(taskEffort);

    ForAll(tasksAssigned As Tasks,
    ForAll(Sequence(Trunc(DateDiff(Tasks.StartDate, Tasks.EndDate,TimeUnit.Days)/7), WeekNum(Tasks.StartDate)) As Weeks,
    Patch(taskEffort, Defaults(taskEffort),
    {
    TaskName: Tasks.TaskName,
    Week: Weeks.Value,
    Effort: Tasks.Effort

    }
    )));

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard