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
MaritoDominguez
New Member

Contar Tiempos de entrada y salidas

Tengo una tabla con los campos: Nombre         Fecha           Tipo     Hora    Indice y Tiempos

Tabla.jpg

 

 

 

 

 

 

 

 

 

 

 

La columna indice tiene esta formula: =CONTAR.SI($A$2:A2,A2)
La columna tiempos tiene esta formula: =SI(A3=A2,D3-D2,"")

 

Esas 2 columnas son adicionales a mi tabla

Lo que yo quiero es cargar mi tabla original en power pivot y desde ahi agregar las 2 columnas y con formulas dax

sacar el indice y sacar la diferencia entre tiempos.

Para posteriormente poder verificar cuanto tiempo estuvo adentro un usuario y cuanto tiempo estuvo afuera.

Necesito saber por cada dia, cuanto tiempo estuvo el usuario adentro y cuanto afuera, para eso necesito la diferencia de tiempos.

En excel se logra facil ya que se manipula la formula, pero no he podido hacerlo en dax.

Alguien me podria ayudar por favor?

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@MaritoDominguez ,

Puede crear dos columnas calculadas de la siguiente manera.

Index = COUNTROWS(FILTER('Table',[Hora]<=EARLIER('Table'[Hora])&&[Nombre]=EARLIER('Table'[Nombre])))

vstephenmsft_0-1681377091771.png

Diff = var _pre=CALCULATE(MAX('Table'[Hora]),FILTER('Table',[Index]< ode="">

vstephenmsft_1-1681377100371.png

Puede descargar el archivo adjunto para obtener más detalles.

Saludos

Esteban Tao

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

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.

Top Kudoed Authors