Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

IF Statement Not Working

Hello guys, I am new to Power BI and trying to figure out how to perform a DAX calculation. Below is a snip of some calculated columns I made:    So with the help of the forum I figured out h...
  • JamesFR06's avatar
    JamesFR06
    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))