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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard