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 / Lookup date to check i...
Power Apps
Answered

Lookup date to check if its weekday

(0) ShareShare
ReportReport
Posted on by 24

Hello I have built an app, to record my hours worked and upload that to my sharepoint list.

 

Screen Shot 2021-01-15 at 4.23.13 PM.png

 

I want to use the "Calculate Pay" button, to lookup if the date I have submitted is weekday or weekend and then calculate my pay = (number of hours * weekend pay rate/ weekday pay rate). Please advise on how to proceed.

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    Hi @m365newuser ,

    The formula would be something like this

    If(
     WeekDay(YourOutDatePicker.SelectedDate) = 1 ||
     WeekDay(YourOutDatePicker.SelectedDate) = 7,
     YourWeekendPayCalc,
     YourWeekDayPayCalc
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • m365newuser Profile Picture
    24 on at

    Thank you for help. 

    Could you explain the logic?

    From my limited understanding by default 0 is Sunday till 6 which is Saturday unless we specify StartOfWeek.Monday for example.

    Furthermore, in your formula is YourWeekendPayCalc a variable? I was hoping to write it as a formula directly without storing the value in a variable and then calling the variable to do the calculation

     

  • Verified answer
    WarrenBelz Profile Picture
    154,910 Most Valuable Professional on at

    @m365newuser ,

    The Default StartOfWeek is Sunday unless you specify otherwise and this is day 1 with Saturday 7 (hence my code).

    The other two are only place holders showing you where to put in your calculation code. I have used names on the controls (In/Out Date/Hour/Minute) that you will have to replace with yours, but I am sure you will get the idea

    With(
     {
     wTime:
     DateDiff(
     InDate.SelectedDate + 
     Time(
     Value(InHour.Selected.Value), 
     Value(InMinute.Selected.Value), 
     0
     ),
     OutDateValue2.SelectedDate + 
     Time(
     Value(OutHour.Selected.Value), 
     Value(OutMinute.Selected.Value), 
     0
     ),
     Hours
     )
     },
     If(
     WeekDay(OutDate.SelectedDate) = 1 ||
     WeekDay(OutDate.SelectedDate) = 7,
     wTime*YourWekendRate,
     wTime*YourWeekdayRate,
     )
    )

    You may also have to use Minutes instead of Hours and divide your rate by 60 if you want partial hours.

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard