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.
Tengo la siguiente tabla, FactEvent. Detalla todos los eventos que un empleado registra todos los días. Necesito categorizar cada evento como un evento de trabajo, ya sea TRUE o FALSE. Un evento de trabajo es cualquier evento que se produce entre los eventos CLOCK IN y CLOCK OUT, inlcusive de un evento CLOCK OUT.
En el ejemplo siguiente, he categorizado incorrectamente los dos eventos entre un período CLOCK IN y CLOCK OUT como TRUE, el evento Badge to Breakroom a las 10:24 AM y el evento Badge to Arcade a las 10:34 AM, definido en la columna isWorkEvent. Necesito que estos dos eventos sean FALSE, como se muestra en la columna isWorkEvent2.
Índice | DateID | Reloj diario en el índice | Daily Clock Out Index | Empleado | Datetime | Evento | TimeOff | isWorkEvent | isWorkEvent2 |
11 | 20200110 | 1 | 11 | John Smith | 1/10/2020 15:45 | CLOCK OUT | Verdad | Verdad | |
10 | 20200110 | 1 | 11 | John Smith | 1/10/2020 15:30 | Final de la última tarea | Verdad | Verdad | |
9 | 20200110 | 1 | 11 | John Smith | 1/10/2020 10:37 | RELOJ EN | Falso | Falso | |
8 | 20200110 | 1 | 11 | John Smith | 1/10/2020 10:37 | CLOCK OUT | Almuerzo sin pagar | Falso | Falso |
7 | 20200110 | 1 | 11 | John Smith | 1/10/2020 10:34 | Insignia a Arcade | Verdad | Falso | |
6 | 20200110 | 1 | 11 | John Smith | 1/10/2020 10:24 | Insignia a Breakroom | Verdad | Falso | |
5 | 20200110 | 1 | 11 | John Smith | 1/10/2020 10:13 | RELOJ EN | Almuerzo sin pagar | Falso | Falso |
4 | 20200110 | 1 | 11 | John Smith | 1/10/2020 10:13 | CLOCK OUT | Verdad | Verdad | |
3 | 20200110 | 1 | 11 | John Smith | 1/10/2020 10:04 | Insignia a Breakroom | Verdad | Verdad | |
2 | 20200110 | 1 | 11 | John Smith | 1/10/2020 10:02 | Primer final de tarea | Verdad | Verdad | |
1 | 20200110 | 1 | 11 | John Smith | 1/10/2020 6:00 | RELOJ EN | Falso | Falso |
Aquí es cómo calculé actualmente isWorkEvent:
isWorkEvent á FactEvent[Index] >-FactEvent[Daily Clock In Index] && FactEvent[Index] <-FactEvent[Daily Clock Out Index] && ISBLANK( FactEvent[TimeOffID] ) && FactEvent[Event] <> "CLOCK IN"
¿Cómo puedo ajustar isWorkEvent para que los dos eventos entre los eventos 10:13 AM CLOCK IN y 10:37 AM CLOCK OUT sean FALSE?
Hola @tonmcg ,
Puede hacer referencia al siguiente DAX:
isWorkEvent =
VAR a =
CALCULATE (
MAX ( FactEvent[Index] ),
FILTER ( FactEvent, FactEvent[TimeOff] = "Unpaid Lunch" )
)
VAR b =
CALCULATE (
MIN ( FactEvent[Index] ),
FILTER ( FactEvent, FactEvent[TimeOff] = "Unpaid Lunch" )
)
RETURN
( FactEvent[Index] >= FactEvent[Daily Clock In Index] )
&& ( FactEvent[Index] <= FactEvent[Daily Clock Out Index] )
&& ( FactEvent[TimeOff] = BLANK () )
&& ( FactEvent[Event] <> "CLOCK IN" )
&& OR ( FactEvent[Index] > a, FactEvent[Index] < b )
Aquí está el resultado.
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 |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |