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 / set value in calendar ...
Power Apps
Answered

set value in calendar excluding weekend

(0) ShareShare
ReportReport
Posted on by 59

Hello Everyone,

I have requirement to display value 1 in calendar and where Saturday and Sunday then display 0 ,

I have 2 Date Picker control Datepicker1 and Datepicker2

demo099_2-1655463877441.png

when Select date between them then set value 1 in label as below

demo099_1-1655463846239.png

Now when I select date between 2 date picker then set value 1 but it also include Saturday and Sunday,

but I want to Exclude Saturday and Sunday and set value 0 at that specific Saturday/Sunday date.

this task in high priority, so please anyone help me with this.

 

Categories:
I have the same question (0)
  • Verified answer
    theapurva Profile Picture
    970 Super User 2024 Season 1 on at

    Please add below condition where you are putting 1 or 0 in calendar

    Weekday(YourDate)=1 ||Weekday(YourDate)=7
    
    Your Formula will look like
    
    If(Weekday(YourDate)=1 ||Weekday(YourDate)=7,0,1)
  • Dynatech123 Profile Picture
    59 on at

    Hi @theapurva ,

    Thanks for your suggestion it's Work Perfectly,

    Now you have any idea how can we include last Saturday of month  in your suggested code,

    please can you help me with this also

  • Verified answer
    theapurva Profile Picture
    970 Super User 2024 Season 1 on at

    This formula returns true if day is last Saturday of month,

    Weekday(YourDate)=7&&(DateAdd(YourDate,7,Days))=Month(YourDate)

     

    so your formula would look as below:

     

    If(Weekday(YourDate)=1 ||(Weekday(YourDate)=7&&(Month(DateAdd(YourDate,7,Days))=Month(YourDate))),0,1)

     

     

  • Dynatech123 Profile Picture
    59 on at

    Hi @theapurva ,

    Thank you for your quick response,

    your suggested code work perfectly for me 

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard