Forum Discussion
IF Statement Not Working
- 2 years ago
Hi
It's normal that shows 0 beause 74.17 is greather than 60. If you just want to calculate for hours >60 change your code like this
= IF(AND(ABCTEMPS[Total by Emp and Week]>40, ABCTEMPS[Total by Emp and Week]>60), 20,0)
and if you want for all calculations:
= IF(AND(ABCTEMPS[Total by Emp and Week]>40, ABCTEMPS[Total by Emp and Week]<60), ABCTEMPS[Total by Emp and Week]-40,IF(ABCTEMPS[Total by Emp and Week]>60,20,0))
Hi
It's normal that shows 0 beause 74.17 is greather than 60. If you just want to calculate for hours >60 change your code like this
= IF(AND(ABCTEMPS[Total by Emp and Week]>40, ABCTEMPS[Total by Emp and Week]>60), 20,0)
and if you want for all calculations:
= IF(AND(ABCTEMPS[Total by Emp and Week]>40, ABCTEMPS[Total by Emp and Week]<60), ABCTEMPS[Total by Emp and Week]-40,IF(ABCTEMPS[Total by Emp and Week]>60,20,0))
Your second DAX formula worked like a charm. The OT 1.5 column now shows 20 hours for each row where an employee worked over 60 hours. Thank you!