SELECT ALL ONLY RECORDS THAT MATCH YOUR MOST RECENT DATE

 

Hello again COMMUNITY, I have a question.

I have a table full of daily logs

Record Id                     Work                   Date                        Work Advance

UNIQUEID()                    Job 1                5/24/2022                       10

 

UNIQUEID()                    Job 2              5/24/2022                        5

 

UNIQUEID() Job 1 5/25/2022 15

What I need is to get a list with unique records of all the jobs corresponding to the table that match their own most recent date. In this case, you would get two records, since the first one is about the same job but with a lower degree of progress for the previous day:

Record Id                  Work                Date                         Work Advance

UNIQUEID()              Job 2                5/24/2022                      5

 

UNIQUEID()               Job 1                 5/25/2022                    15


Does anyone know how to do this? From already thank you very much

 

Solved Solved
0 6 122
1 ACCEPTED SOLUTION

After so much work I got the solution for the jobs table. What I have to do to obtain the individualized and actualized expenses for each job is the following:

MAX([Related PROGRESS][EXPECTED COST])/
SUM(
          SELECT(
Trabajos[FINAL COST],
AND([CLIENT NAME]=[_THISROW].[CLIENT NAME],
[WORK]=[_THISROW].[WORK])

)
)

View solution in original post

6 REPLIES 6

Hola Gus,

You can create a slice on your table with the following Row Filter Condition:

[Date] = MAX(
  SELECT(table[Date], [Work] = [_ThisRow].[Work])
)

This slice will dynamically contain only one record per work, and it will be the latest one. 

Joseph, estuve intentando pero me resulta complicado quizás porque no paro desde la mañana. 
Supongamos de la app que te pase, en la tabla Obras, me gustaría poder visualizar los avances de las obras. Para eso tengo que seleccionar el [Gasto esperado según avance] de la tabla Avances para todos los registros que son relates avances. Pero cuya condición sea que la fecha de registro para cada uno de ellos sea la máxima. 

Ahora, supongamos que hago dicho slice, será posible hacer un Select, pero en vez de hacerlo sobre la tabla avances hacerlo sobre el slice recién creado?

Esta buenísima la solución @Joseph_Seddik, Por el momento te paso lo que pensé, dame un segundo que lo estoy elaborando!

Hola Gus. No me queda claro por qué fin vas a hacer el SELECT, pero en todos casos, sí, puedes hacer un SELECT sobre un Slice, y de manera general, puedes hacer en el Slice todas las operaciones que se pueda hacer en una tabla. 

After so much work I got the solution for the jobs table. What I have to do to obtain the individualized and actualized expenses for each job is the following:

MAX([Related PROGRESS][EXPECTED COST])/
SUM(
          SELECT(
Trabajos[FINAL COST],
AND([CLIENT NAME]=[_THISROW].[CLIENT NAME],
[WORK]=[_THISROW].[WORK])

)
)

Quiero darte nuevamente gracias Joseph por tu predisposición amigo! Marqué mi solución como solución porque no necesito hacer un slice sino simplemente contar con los datos para análisis en otra tabla, de forma virtual. Un abrazo grande amigo!

Top Labels in this Space