Forum Discussion
Automate operator for each change in root table
- Anonymous5 years ago
Hi cprpontes ,
Please try the following to see if the problem above still occurs.
Calculate the maximum time and minimum time.
Max Time = CALCULATE ( MAX ( 'operators'[HR I/F] ), FILTER ( 'operators', 'operators'[OPERADOR] = EARLIER ( 'operators'[OPERADOR] ) && 'operators'[ESTAÇÃO] = EARLIER ( 'operators'[ESTAÇÃO] ) ) )Min Time = CALCULATE ( MIN ( 'operators'[HR I/F] ), FILTER ( 'operators', 'operators'[OPERADOR] = EARLIER ( 'operators'[OPERADOR] ) && 'operators'[ESTAÇÃO] = EARLIER ( 'operators'[ESTAÇÃO] ) ) )Then:
REV OPER = CALCULATE ( MAX ( 'operators'[OPERADOR] ), FILTER ( 'operators', 'operators'[Min Time] < EARLIER ( 'Failures'[HR I/F] ) && 'operators'[Max Time] > EARLIER ( 'Failures'[HR I/F] ) && 'operators'[ESTAÇÃO] = EARLIER ( 'Failures'[ESTAÇÃO] ) ) )A sample PBIX. for your reference is attached.
Hope it helps,
Community Support Team _ Caitlyn Yan
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi cprpontes ,
Please try the following to see if the problem above still occurs.
Calculate the maximum time and minimum time.
Max Time =
CALCULATE (
MAX ( 'operators'[HR I/F] ),
FILTER (
'operators',
'operators'[OPERADOR] = EARLIER ( 'operators'[OPERADOR] )
&& 'operators'[ESTAÇÃO] = EARLIER ( 'operators'[ESTAÇÃO] )
)
)
Min Time =
CALCULATE (
MIN ( 'operators'[HR I/F] ),
FILTER (
'operators',
'operators'[OPERADOR] = EARLIER ( 'operators'[OPERADOR] )
&& 'operators'[ESTAÇÃO] = EARLIER ( 'operators'[ESTAÇÃO] )
)
)
Then:
REV OPER =
CALCULATE (
MAX ( 'operators'[OPERADOR] ),
FILTER (
'operators',
'operators'[Min Time] < EARLIER ( 'Failures'[HR I/F] )
&& 'operators'[Max Time] > EARLIER ( 'Failures'[HR I/F] )
&& 'operators'[ESTAÇÃO] = EARLIER ( 'Failures'[ESTAÇÃO] )
)
)
A sample PBIX. for your reference is attached.
Hope it helps,
Community Support Team _ Caitlyn Yan
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
thank you very much for the support, now it worked as expected, through your help the code was great.
I just added one more condition to get the date linked to the operator. thank you!