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 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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,233)