web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to count no of wor...
Power Apps
Unanswered

How to count no of working days

(0) ShareShare
ReportReport
Posted on by

i have 1 date picker, when user select date - it should show count of working days excluding weekends & holidays in that selected month.
holidays stored in Collection as 

ClearCollect(Holidays,

{Date1:7/24/2023,Type:Pioneer Day},

etc......

Categories:
I have the same question (0)
  • Verified answer
    v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @venky232 ,

     

    The Collection you offered.

    vhanytianmsft_0-1690186167314.png

    Text of TextLabel:

    With(
    {
    varDateRange: ForAll(
    Sequence(31,1),
    Text(Month(DatePicker1.SelectedDate) & "/" & Value & "/" & Year(DatePicker1.SelectedDate),"DD/MM/YYYY")
    )
    },
    // show only dates Monday to Friday and exclude holidays
    CountIf(
    varDateRange,
    And(
    Weekday(Value,StartOfWeek.Sunday) in [2, 3, 4, 5, 6],
    Not(Value in Holidays.Date1)
    )
    )
    )

    vhanytianmsft_1-1690186224181.png

     

    Hope this will help you,

    Best Regards,
    Tina

     

  • venky232 Profile Picture
    on at

    but it is not excluding holidays list from collection

    ClearCollect(
    Col_Holidaylist,
    Table(
    {Date1: Text(DateValue("16-Jan-2023"), "d-mmm-yyyy"), Type: "Optional Holiday"},
    {Date1: Text(DateValue("26-Jan-2023"), "d-mmm-yyyy"), Type: "Company Holiday"},
    {Date1: Text(DateValue("8-Mar-2023"), "d-mmm-yyyy"), Type: "Optional Holiday"},
    {Date1: Text(DateValue("22-Mar-2023"), "d-mmm-yyyy"), Type: "Optional Holiday"},
    {Date1: Text(DateValue("4-Apr-2023"), "d-mmm-yyyy"), Type: "Optional Holiday"}
    {
    )
    );

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard