The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I need to transfer this calculation into a table as the dashboard has become too slow:
Overtime =
VAR currentEmpID = MAX ( 'Timesheet Data'[Employee ID])
VAR currentLDW = MAX ( 'Timesheet Data'[last_day_of_week])
VAR currentContractHours = MAX ( 'Timesheet Data'[Work_Week_Hours] )
VAR OT =
CALCULATE (
SUM ( 'Timesheet Data'[Hours] ),
FILTER (
ALL ( 'Timesheet Data'[Employee ID], 'Timesheet Data'[last_day_of_week] ),
'Timesheet Data'[Employee ID] = currentEmpID
&& 'Timesheet Data'[last_day_of_week] = currentLDW
)
) - currentContractHours
RETURN OT
THe way I planned to do it is to place the 3 VAr statements into a table:
VAR currentEmpID = MAX ( 'Timesheet Data'[Employee ID])
VAR currentLDW = MAX ( 'Timesheet Data'[last_day_of_week])
VAR currentContractHours = MAX ( 'Timesheet Data'[Work_Week_Hours] )
--------------------------------------------------------
And I am trying this:
Hi amitchandax, Work_Week_Hours is decimal type. maybe create diferent tables for the MAX values and the SUM I hear you say?
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |