cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pword
Helper IV
Helper IV

Holidays for 2022

I have problem with my holidays, When i filing a leave for Jan 1, 2022 the holiday was included

Example:

 

pword_0-1637564231519.png

 

The number of days should be 2 days

 29, 30(holiday), 31, 1(holiday)

 

 

If(varCalculationActive1,
 If(

        Leavetype.Selected.Value = "Maternity leave",
        If(
            StartDates.SelectedDate <= EndDates.SelectedDate,
            DateDiff(
                StartDates.SelectedDate,
                EndDates.SelectedDate,
                Days
            ) + 1 - If(
                Checkbox3.Value,
                0.5
            )
        ),
        (If(
            StartDates.SelectedDate = EndDates.SelectedDate,
            Sum(
                If(
                    Weekday(StartDates.SelectedDate) = 1,
                    0,
                    1
                )
            ) - If(
                Checkbox3.Value,
                0.5
            ),
            If(
                StartDates.SelectedDate > EndDates.SelectedDate,
                -Sum(
                    ForAll(
                        Sequence(
                            DateDiff(
                                EndDates.SelectedDate,
                                StartDates.SelectedDate,
                                Days
                            ),
                            0,
                            1
                        ),
                        If(
                            Weekday(
                                DateAdd(
                                    EndDates.SelectedDate,
                                    Value
                                )
                            ) = 1,
                            {DayCount: 0},
                            {DayCount: 1}
                        )
                    ),
                    DayCount
                ) - If(
                    Checkbox3.Value = false,
                    0.5
                ) - 1/2,
                Sum(
                    ForAll(
                        Sequence(
                            DateDiff(
                                StartDates.SelectedDate,
                                EndDates.SelectedDate,
                                Days
                            ),
                            0,
                            1
                        ),
                        If(
                            Weekday(
                                DateAdd(
                                    StartDates.SelectedDate,
                                    Value
                                )
                            ) = 1,
                            {DayCount: 0},
                            {DayCount: 1}
                        )
                    ),
                    DayCount
                ) + If(
                    Checkbox3.Value = false,
                    0.5
                ) + 1 / 2
                
            ) - CountRows(
                Filter(
                    colHolidays,
                    HolidayDates >= StartDates.SelectedDate,
                    HolidayDates <= EndDates.SelectedDate
                )
            )
        ))
    )
)

 

 

@StalinPonnusamy 

0 REPLIES 0

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (4,625)