Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Timediff entre 2 filas dependiendo de índice+columna

Hola

¿Cómo calcularía la diferencia de tiempo en función de una columna índice y shiftID?

Ejemplo:

Se agrega una columna Indeks,

Filtro: shiftid

Inicio de residuos: 2022-03-02 08:17:23

Inicio de carrera: 2022-03-02 07:15:34

Resultado deseado: Diferencia de tiempo (el formato podría ser segundos..)

2022-03-02_15-58-37.jpg

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@Blaest , En caso de que necesites una medida

nueva columna =
var _max = maxx(filter(allselected(Table), [Index] < max([Index]) && [shift ID] = max( Table[shift ID] )),[Index])
devolución
datediff(maxx(filter(allselected(Table), [Index] =_index && [shift ID] = max( Table[shift ID] )),[Waste Stop]),, Min([Waste Start]), segundo)

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Gracias @amitchandak ,

Cambié el nombre del varible (de: _index a _var) y eliminé uno de los "," donde doble - después de eso parecía funcionar,

Lo único que queda es que todos los valores deben estar en la ubicación anterior (valor Indeks más bajo),

¿Cómo corregiría eso en el código?

2022-03-02_19-35-47.jpg

Running (Seconds) =
var _max = 
maxx (
filter ( allselected (Waste) ,
[Indeks] < max( [Indeks] ) && [shiftId] = max( Waste [shiftId] )) ,
[Indeks]
)

return

datediff (
maxx ( filter ( allselected (Waste) , 
[Indeks] = _max && [shiftId] = max(  Waste [shiftId] ) ) ,
[Waste Stop] ) ,
Min( [Waste Start] ) ,
second
)

Syndicate_Admin
Administrator
Administrator

@Blaest , En caso de que necesites una medida

nueva columna =
var _max = maxx(filter(allselected(Table), [Index] < max([Index]) && [shift ID] = max( Table[shift ID] )),[Index])
devolución
datediff(maxx(filter(allselected(Table), [Index] =_index && [shift ID] = max( Table[shift ID] )),[Waste Stop]),, Min([Waste Start]), segundo)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.