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
jwi1
Post Patron
Post Patron

Calcular período de escala de tiempo

Hola a todos

Tengo una pregunta abour un cálculo de la línea de tiempo basado en la tabla siguiente.

Si la POSICION y el CTR_NR es el mismo y el TIPO es WAITING ESTIMATE o UNDER REPAIR, quiero calcular el marco de tiempo hasta el siguiente TIME_STAMP.

Por ejemplo:

MNBU3337892 está en la posición WP4.19.

El TIME_STAMP de LA ESTIMACION DE ESPERA es 26-10-2020 07:00.

La siguiente marca de tiempo después de LA ESTIMACION DE ESPERA es REPARAR COMPLETA en 26-10-2020 09:00

Por lo tanto, el resultado del cálculo es de 2 horas.

¡Espero que alguien pueda ayudarme con esto!

John

Posiciónctr_nrTipotime_stamptime_period (hrs)
WP4.19MNBU3447892Estimación de espera26-10-2020 07:002
WP4.19MNBU3447892Reparación completa26-10-2020 09:00
WP4.19SUDU8068773Estimación de espera26-10-2020 22:006
WP4.19SUDU8068773A la espera de la autorización27-10-2020 04:00
WP4.19HLCU9852359En Reparación29-10-2020 11:003
WP4.19HLCU9852359Reparación completa29-10-2020 14:00
2 ACCEPTED SOLUTIONS
TomMartens
Super User
Super User

Hola @jwi1 ,

Me pregunto si hay orden de tipos. Digamos que

1. Estimación de espera

2. En Reparación

3. ...

saludos

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

ryan_mayu
Super User
Super User

@jwi1

puede intentar crear una columna

Column = 
VAR _time=minx(FILTER('Table','Table'[ctr_nr]=EARLIER('Table'[ctr_nr])&&'Table'[time_stamp]>EARLIER('Table'[time_stamp])),'Table'[time_stamp])
return if('Table'[type]="Waiting Estimate"||'Table'[type]="Under Repair",DATEDIFF('Table'[time_stamp],_time,HOUR),BLANK())

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@jwi1

puede intentar crear una columna

Column = 
VAR _time=minx(FILTER('Table','Table'[ctr_nr]=EARLIER('Table'[ctr_nr])&&'Table'[time_stamp]>EARLIER('Table'[time_stamp])),'Table'[time_stamp])
return if('Table'[type]="Waiting Estimate"||'Table'[type]="Under Repair",DATEDIFF('Table'[time_stamp],_time,HOUR),BLANK())

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




TomMartens
Super User
Super User

Hola @jwi1 ,

Me pregunto si hay orden de tipos. Digamos que

1. Estimación de espera

2. En Reparación

3. ...

saludos

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

@TomMartens buen día,

De hecho, hay una orden determinada:

La estimación de espera puede dar lugar a una estimación completa o de espera de la reparación.

En reparación puede resultar en la reparación completa

Gracias

John

Hola @jwi1 ,

preguntándose cómo encaja "Esperando autorización" en esto?

¿Hay un error tipográfico o puede haber más "estimaciones de espera" antes de que se convierta en "Reparación completa".

saludos

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hola @TomMartens ,

Lo siento, error tipográfico.... 😅

Por favor lea:

La estimación en espera puede dar lugar a la reparación completa o a la espera de la autorización.

En reparación puede resultar en Reparación Completa

John

Hola @jwi1

Puede intentar agregar una nueva columna con el siguiente código DAX:

Hours =
IF (
    'Table'[type] IN { "Waiting Estimate", "Under Repair" },
    DATEDIFF (
        'Table'[time_stamp],
        MINX (
            FILTER (
                'Table',
                'Table'[position] = EARLIER ( 'Table'[position] )
                    && 'Table'[ctr_nr] = EARLIER ( 'Table'[ctr_nr] )
                    && 'Table'[time_stamp] > EARLIER ( 'Table'[time_stamp] )
            ),
            'Table'[time_stamp]
        ),
        HOUR
    ),
    BLANK ()
)

10293.jpg

Saludos

Equipo de apoyo a la comunidad _ Jing Zhang

Si este post ayuda,por favor considere Aceptarlo como la solución para ayudar a otros miembros a encontrarlo.

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.