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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.