cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bochie
Resolver I
Resolver I

Adding values from overlapping dates

Hi All!

 

Been trying to build an app where I need to add values based on overlapping dates. For example below, the top row of numbers signify day-dates (starts June 22, day I'm posting this).  My gallery has 3 items, signified by the gantt bars. Each item has a column/field "WorkEffort". The work effort for each bar is 25 for the first, 75 for the second and 25 for the third bar. What I'm trying to do is add the work effort numbers for overlapping dates. Such that for June 27-June 30, I should have a total work effort sum of 100 and the same from Jul 5 - Jul15. The work effort numbers I stored in a nested gallery and used AddColumns formula so that each day I can reference the work effort for each bar. What I can't figure out is how to add work effort for overlapping dates.

Bochie_0-1655941768586.png

 Here's the formula for my main gallery:

 

AddColumns(
    ShowColumns(
        Filter(
            Assignments,
            Resource.Email = User().Email && Status = "Active"
        ),
        "StartDate",
        "EndDate",
        "WorkEffort",
        "TeamMember",
        "Status"
    ),
    "NumDays",
    FirstN(
        ForAll(
            Sequence(65),
            StartDate + Value - 1
        ),
        DateDiff(
            StartDate,
            EndDate,
            Days
        ) + 1
    ),
    "Day",
    "Day " & (Value + 1),
    "Date",
    DateAdd(
        StartDate,
        Value,
        Days
    )
)

 

 

The formula I used for my sub-gallery to show the work effort values is below. I've tried to add a column using a For All to add them but I've hit a wall. I also tried to group by day (that is why I have created a Date column in main gallery) and then ungroup but kept getting an error. Appreciate any help/hint on how to solve this. Thank you!

 

AddColumns(
    ThisItem.NumDays,
    "WorkEffortNumber",
    ThisItem.WorkEffort
)

 

 -bochie

0 REPLIES 0

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (6,117)