Forum Discussion
New Column with IF STATEMENT
- 3 years ago
is this what you want?
Column 2 = if('Table'[Column]="OT", CALCULATE(sum('Table'[Hours]),ALLEXCEPT('Table','Table'[Date],'Table'[Employee]))-8,0) - 3 years ago
pls provide the sample data
Thank you very much, it works perfect. Now, I want to calculate how many OT hours for each employee. I've tried something like this to create a new column but of course it didn't work.
is this what you want?
Column 2 = if('Table'[Column]="OT", CALCULATE(sum('Table'[Hours]),ALLEXCEPT('Table','Table'[Date],'Table'[Employee]))-8,0)
- PowerBIFreak3 years agoHelper II
Sorry for the delay. Yours look exactly what I need but when I applied the code to mine, the calculation is totally off. I don't know what happened. Thank you so much for your time.😊🙏
- ryan_mayu3 years agoSuper User
pls provide the sample data
- PowerBIFreak3 years agoHelper II
Good morning Ryan. Thank you very much for following up. I think I don't need further assistance because the report that I downloaded did indicate the OT hours for each employee outside of the normal hours. That way, I can just filter them out when I did the report. Thank you again for your help. Have a great day.