Forum Discussion
Calculate Overtime
- 10 years ago
Hi navarrobr,
In your scenario, you can create two new tables 'Woked' and 'Available', then build a relationship between those two tables. Please follow steps below:
1. Create 'Available' table.
Available = SUMMARIZE('Table','Table'[Date],"Available Hours",CALCULATE(SUM('Table'[Hours]),'Table'[Hour Type]="available"))2. Create 'Worked' table' and a calculated column 'OverTime'.
Worked = SUMMARIZE('Table','Table'[Date],"Worked Hours",CALCULATE(SUM('Table'[Hours]),'Table'[Hour Type]="worked"))OverTime = IF('Worked'[Worked Hours]>RELATED('Available'[Available Hours]),[Worked Hours]-RELATED('Available'[Available Hours]),0)3. Build relationships.
4. Create a table visual.
If you have any question, please feel free to ask.
Best Regards,
Qiuyun Yu - 9 years ago
Hi navarrobr,
In your scenario, you can create two new tables 'Woked' and 'Available', then build a relationship between those two tables. Please follow steps below:
1. Create 'Available' table.
Available = SUMMARIZE('Table','Table'[Date],"Available Hours",CALCULATE(SUM('Table'[Hours]),'Table'[Hour Type]="available"))
2. Create 'Worked' table' and a calculated column 'OverTime'.
Worked = SUMMARIZE('Table','Table'[Date],"Worked Hours",CALCULATE(SUM('Table'[Hours]),'Table'[Hour Type]="worked"))
OverTime = IF('Worked'[Worked Hours]>RELATED('Available'[Available Hours]),[Worked Hours]-RELATED('Available'[Available Hours]),0)
3. Build relationships.
4. Create a table visual.
If you have any question, please feel free to ask.
Best Regards,
Qiuyun Yu