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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Moving Range con el tiempo

Estoy tratando de obtener el tiempo de una fila a la siguiente para determinar cuánto tiempo ha transcurrido de cada entrada.

Actualmente estoy usando esta declaración DAX:

Moving Range = 
VAR a =
    CALCULATE (
        FIRSTNONBLANK ( Query1[Time], 1 ),
       FILTER(
        'Query1',
        'Query1'[Test]= EARLIER('Query1'[Test] - 1  ))
    )
RETURN
    IF ( a = BLANK (), BLANK(), DATEDIFF( a , Query1[Time],MINUTE))

Pero me da un error cuando lo uso. He publicado algunos datos de muestra para ayudar con esto.

El mismo día: es un índice que me indica que la entrada es el mismo día.

Prueba: es el índice de los eventos que están en el mismo día.

image.png

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hola @Coglizer,

Puede agregar una columna de índice en el Editor de consultas. A continuación, cree una columna calculada como la siguiente:

Moving Range á var pre-CALCULATE(SUM('Table'[Time]),FILTER('Table','Table'[Same Day Count]'EARLIER('Table'[Same day Count])&&'Table'[Index]'EARLIER('Table'[Index])-1))
devolver IF(pre-BLANK(),BLANK(),DATEDIFF(pre,'Table'[Time],MINUTE))

q3.PNG

Saludos
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hola @Coglizer,

Puede agregar una columna de índice en el Editor de consultas. A continuación, cree una columna calculada como la siguiente:

Moving Range á var pre-CALCULATE(SUM('Table'[Time]),FILTER('Table','Table'[Same Day Count]'EARLIER('Table'[Same day Count])&&'Table'[Index]'EARLIER('Table'[Index])-1))
devolver IF(pre-BLANK(),BLANK(),DATEDIFF(pre,'Table'[Time],MINUTE))

q3.PNG

Saludos
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HotChilli
Super User
Super User

Primera pregunta: ¿cuál es el error?

¿No se resalta el texto ofensivo en la fórmula?

Parece que hay un corchete fuera de lugar en la cláusula EARLIER

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors