Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Multiple IF Condition and return value

 

Name ClockIn ClockOut HoursWorked
Ryan 06:44 14:44 7:59
Ryan 07:04 14:21 7:17
Jerome 6:40 13:10 6:30
Jerome 7:05 15:35 8:30
Katie 07:20 14:23 7:03
Katie 6:46 13:11 6:25
Ariana 07:15 12:55 5:40
Ariana 06:58 15:09 8:11

 

 hello so i have this table, i want an if condition for employees as it goes,

ryan and jerome are my only 2 supervisors so if they arrive before 6:45, it should always be 6:45 but if they arrive after 6:45, let it be the time they arrived, similar for all the rest of my employees in this example, its ariana and katie,, but instead of 6:45 its 7:00,

 

so i want something like : if(name = "Ryan" and "Jerome" AND clock in is <=6:45 ) let it be 6:45, ELSE (time they arrive)) AND if(name = "all other employees" AND clock in is<= 7:00) let it be 7:00, ELSE(time they arrive)

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Another approach which I find it more feasible is to have a dimension table of the standard working times. Here is a sample file https://www.dropbox.com/t/Dd02knQPHCaqUbRY

You can also apply the same to the duty finish time. I  guess your ultimate goal is to calculate the hours worked ignoring early clockin and late clockout. You can calculate both values and store them in variables and then calculate the difference directly without having to create unnecessary new columns. 
Both measure and calculated column options are provided in the solution.

1.png2.png3.png1.png

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @Anonymous 
Another approach which I find it more feasible is to have a dimension table of the standard working times. Here is a sample file https://www.dropbox.com/t/Dd02knQPHCaqUbRY

You can also apply the same to the duty finish time. I  guess your ultimate goal is to calculate the hours worked ignoring early clockin and late clockout. You can calculate both values and store them in variables and then calculate the difference directly without having to create unnecessary new columns. 
Both measure and calculated column options are provided in the solution.

1.png2.png3.png1.png

@Anonymous in this case you have a problem if you had added new employees in first table that you wouldn't have added in table "Working hours".

Be careful!

Also you can create this table in Google Spreadsheets and connect it with Power Apps.

Then add Power Apps to your dashboard.

technolog
Super User
Super User

IF( OR( [Name] = "Ryan", [Name] = "Jerome" ),

   IF( [ClockIn] < TIME( 6, 45 , 0) , TIME (6, 45, 0) , "AFTER 6:45" ),

   IF ( [ClockIn] < TIME( 7, 0 , 0) , TIME (7, 0, 0) , "AFTER 7:00" )

)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.