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.
Hola
Tengo una tabla que tiene las siguientes columnas (adjuntas) y me gustaría calcular/devolver solo el estado más reciente, en este ejemplo 37. Esto es sólo un subconjunto de todo el conjunto de datos que consta de diferentes países y elementos. He intentado usar las funciones lastdate, max pero no puedo resolver la lógica.
¡Gracias por tu ayuda!
Solved! Go to Solution.
No @Brighton10,
Puede utilizar un dax de la siguiente manera:
StatusInLast24Horas ?
var t1 - SELECTEDVALUES(tablename[datetime])
var t2 a t1 - 1
devolución
CALCULATE(MAX(tablename[status]), tablename[dateTime] <- t1 && tablename[dateTime] > t2)
Gracias
Pragati
Pruebe la siguiente medida considerando que la columna Datetime tiene un formato de fecha y hora adecuado.
No @Brighton10,
Puede escribir la siguiente medida DAX:
Estado reciente (RecentStatus)
var t1 á MAX(tablename[dateTime])
devolución
CALCULATE(MAX(tablename[status]), tablename[dateTime] á t1)
Gracias
Pragati
Gracias @Pragati11, Su solución funciona perfectamente. Sólo una pregunta de seguimiento. Si quiero que la fecha y hora se filtre de las 24 horas anteriores. ¿Cómo puedo implementar eso?
No @Brighton10,
Puede utilizar un dax de la siguiente manera:
StatusInLast24Horas ?
var t1 - SELECTEDVALUES(tablename[datetime])
var t2 a t1 - 1
devolución
CALCULATE(MAX(tablename[status]), tablename[dateTime] <- t1 && tablename[dateTime] > t2)
Gracias
Pragati
@Brighton10 , Pruebe una medida como
lastnonblankvalue(Table[datetime], max(Table[Status]))
calculate(lastnonblankvalue(Table[datetime], max(Table[Status])), all(Table))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |