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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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