Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi experts! 😄
I have a problem to check the overtime based on multiple-conditions.
I have a table that have columns;
1. HoursWorked
2. ShiftHours > 30 mins
3. Day Type: Whether "Working day" or "Off day"
I have ShiftHours > 30 mins column to check that on "Normal day"
if [HoursWorked] >= [ShiftHours > 30 mins], "!", "-"
when i try to do it,
here is my code for that;
But it will be different if that employee worked on "Off day". Because, the total hours for that day will be count as "Overtime" right?
Below is the logic example;
So my Questions are;
1. Why my second image shows like that? Is there any problem with my measure?
2. Any possible way for me to calculate Overtime based on multiple conditions (Day type)?
Thanks in advance for all!
Hi @New_be ,
Sorry to disturb you...... But did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
Hi @New_be ,
You could use the following formula:
OverTime =
IF (
MAX ( 'Table1'[Day Type] ) = "Off day",
MAX ( 'Table1'[Hours worked] ),
MAX ( 'Table1'[Hours worked] ) - MAX ( 'Table1'[ShiftHours > 30mins] )
)
My visualization looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
VAR WorkingDayhours = calculate(working hours, daytype="Working dAy")
VAR offdayhours = calculate(working hours, daytype = offday)
RETURN
SWitch(TRUE(),
workdayhours>8,workdayhours-8,
offdayhours)
Try this funciton to get the desired result
Proud to be a Super User!
@New_be ,
|| _offDay what you want to do there.
Can you full condition like
Not(Isblank(_offDay )) or Isblank(_offDay ) or [Workday] >_offDay and try.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |