forked from rdorrani/PowerApps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
duedateworkingdays
74 lines (74 loc) · 1.45 KB
/
duedateworkingdays
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
ClearCollect(
colHolidays, // This collection will contain the holiday information.
Filter(
Holidays, // Holidays is coming from my data source which is a SharePoint list. *** Change this based on your scenario.
Year(HolidayDate) = Year(Now()) // This is the filter criteria in my scenario to get holidays for current year only.
)
);
Clear(colDateRange);
ForAll(
[
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40
],
Collect(
colDateRange,
{
RowIndex: CountRows(colDateRange) + 1,
Date: DateAdd(
Today(),
Value
)
}
)
);
/*HolidayDate is my SharePoint column of type Date. Query here will filter out the holidays.
Make sure to replace the HolidayDate column name based on the information from your data source. */
RemoveIf(
colDateRange,
Weekday(Date) = 1 || Weekday(Date) = 7 || CountRows(
Filter(
colHolidays,
HolidayDate >= Date,
HolidayDate <= Date
)
) > 0
);