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 / Problem with my formul...
Power Apps
Answered

Problem with my formula that is using an If condition?

(0) ShareShare
ReportReport
Posted on by 379

I am trying to determine the percentage when employees report overtime in a given week. In my percentage control I have this formula:

 

// Need to check to see if the Total hours in a workweek is more then 40 hours, if true, then OT performed on
// Mon or Tue or Wed or Thu or Fri or Sat needs to be charged at 150 - OT performed on Sun or Holiday needs to
// charged at 200%

 

The problem I am having is that the Percentage is not being returned by the formula below.  I have no idea what I am doing wrong here.


If(LabelTotalHours > 40,
Text(
DataCardValueOTEdit.SelectedDate,
"ddd"
) = "Sun",
200,
If(
LookUp(
OREHolidays,
DateHoliday = DataCardValueOTEdit.SelectedDate,
true
),
200,
150
)
)

 

In my Label Control named LabelTotalHours I keep a running total of all hours for a given workweek.

This is the formula used in that label control:

 

With(
{
wList:
Filter(
'OREPayrollOvertime',
Week=GalleryBrowseOvertime.Selected.Week &&
EmpID=GalleryOTResManagers.Selected.ID
)
},
Sum(
wList,
OvertimeHours
) + 38
)

 

Categories:
  • Verified answer
    Lorem1960 Profile Picture
    379 on at

    Sorry my mistake I fixed the formula like this:

     

    If(
    Value(LabelTotalHours.Text) > 40 &&
    Text(
    DataCardValueOTEdit.SelectedDate,
    "ddd"
    ) = "Sun",
    200,
    If(
    LookUp(
    OREHolidays,
    DateHoliday = DataCardValueOTEdit.SelectedDate,
    true
    ),
    200,
    150
    )
    )

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard