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!
Estoy tratando de crear una fórmula DAX para generar un estado para uno de los procesos que administre en el trabajo. Podemos rastrear dónde están las cosas en función de un montón de diferentes columnas de fecha y datos de filete de diferentes maneras, pero realmente me gustaría obtener algunas estadísticas sobre cuántos elementos tenemos en cada etapa del proceso.
He subido un ejemplo de los datos a las hojas de Google por lo que es un poco más fácil entender lo que quiero decir: https://docs.google.com/spreadsheets/d/1SutkBB19HZc0sqDXOzvHZNzsJjEGm_uzfisIJFEV-Ek/edit?usp=sharing
Lo que quiero lograr es que cada fila muestre un estado generado automáticamente (consulte el enlace anterior).
En cuanto a los parámetros para el estado, estoy pensando algo como el siguiente. pero no puedo -por mi vida- averiguar cómo poner esto en una fórmula DAX.
He estado rompiendo mi cerebro para entender esto, creo que lo he mirado demasiado tiempo y definitivamente lo estoy complicando demasiado. He manejado algo muy cercano a lo que quería creando algunas medidas y conectándolo todo con fórmulas IF anidadas, pero no puedo obtener todos los estados allí con precisión. He estado tratando de encontrar otras soluciones durante horas, pero ya no puedo, así que pensé en pedir ayuda 😊
¿Puede uno de ustedes gente encantadora por favor guiarme en la dirección correcta para resolver esto? Cualquier pequeña ayuda será muy apreciada.
Salud
Sabrina
Solved! Go to Solution.
Esto nos lleva la mayor parte del camino hasta que se resuelva la duplicación que acondé hace antes. El truco con SWITCH es conseguir las cosas en el orden correcto, porque si una prueba no es muy específica, atrapará muchas más filas de las que debería.
Status =
SWITCH (
TRUE (),
NOT ( ISBLANK ( 'Table'[Date Requested] ) )
&& ISBLANK ( 'Table'[Date Received] )
&& NOT ( ISBLANK ( 'Table'[Date Resolved] ) )
&& OR ( 'Table'[Result] = "Invalid", 'Table'[Result] = "Non-Compliant" ), "Materials Never Received",
NOT ( ISBLANK ( 'Table'[Date Requested] ) )
&& ISBLANK ( 'Table'[Date Received] )
&& 'Table'[Date Return Due] >= TODAY (), "Materials Requested",
NOT ( ISBLANK ( 'Table'[Date Requested] ) )
&& 'Table'[Date Return Due] <= TODAY ()
&& ISBLANK ( 'Table'[Date Received] ), "Materials Overdue",
NOT ( ISBLANK ( 'Table'[Date Received] ) )
&& ISBLANK ( 'Table'[Date Evidence Sent] ), "Materials Received",
OR ( 'Table'[Result] = "Approved", 'Table'[Result] = "Not Approved" )
&& NOT ( ISBLANK ( 'Table'[Date Resolved] ) )
&& ISBLANK ( 'Table'[Date Report Sent] ), "Report Received",
OR ( 'Table'[Result] = "Approved", 'Table'[Result] = "Not Approved" )
&& NOT ( ISBLANK ( 'Table'[Date Resolved] ) )
&& NOT ( ISBLANK ( 'Table'[Date Report Sent] ) ), "Report Sent",
NOT ( ISBLANK ( 'Table'[Date Received] ) )
&& NOT ( ISBLANK ( 'Table'[Date Evidence Sent] ) )
&& 'Table'[Date Evidence Sent] + 14
> TODAY (), "Sent to a Moderator",
NOT ( ISBLANK ( 'Table'[Date Received] ) )
&& NOT ( ISBLANK ( 'Table'[Date Evidence Sent] ) )
&& 'Table'[Date Evidence Sent] + 14
< TODAY (), "Report Overdue"
)
Espero que esto ayude
David
Hola @sabrinafp -
Tiene duplicados en su ejemplo
4 2020-07-31 2020-08-01 2020-08-02 2020-08-03 Enviado a un moderador
5 2020-07-31 2020-08-01 2020-08-02 2020-08-03 Informe atrasado
10 2020-08-02 2020-08-03 Enviado a un moderador
11 2020-08-02 2020-08-03 Informe atrasado
Si puede resolver esos duplicados, probablemente podemos hacerlo con una columna calculada y un comando SWITCH.
Esto nos lleva la mayor parte del camino hasta que se resuelva la duplicación que acondé hace antes. El truco con SWITCH es conseguir las cosas en el orden correcto, porque si una prueba no es muy específica, atrapará muchas más filas de las que debería.
Status =
SWITCH (
TRUE (),
NOT ( ISBLANK ( 'Table'[Date Requested] ) )
&& ISBLANK ( 'Table'[Date Received] )
&& NOT ( ISBLANK ( 'Table'[Date Resolved] ) )
&& OR ( 'Table'[Result] = "Invalid", 'Table'[Result] = "Non-Compliant" ), "Materials Never Received",
NOT ( ISBLANK ( 'Table'[Date Requested] ) )
&& ISBLANK ( 'Table'[Date Received] )
&& 'Table'[Date Return Due] >= TODAY (), "Materials Requested",
NOT ( ISBLANK ( 'Table'[Date Requested] ) )
&& 'Table'[Date Return Due] <= TODAY ()
&& ISBLANK ( 'Table'[Date Received] ), "Materials Overdue",
NOT ( ISBLANK ( 'Table'[Date Received] ) )
&& ISBLANK ( 'Table'[Date Evidence Sent] ), "Materials Received",
OR ( 'Table'[Result] = "Approved", 'Table'[Result] = "Not Approved" )
&& NOT ( ISBLANK ( 'Table'[Date Resolved] ) )
&& ISBLANK ( 'Table'[Date Report Sent] ), "Report Received",
OR ( 'Table'[Result] = "Approved", 'Table'[Result] = "Not Approved" )
&& NOT ( ISBLANK ( 'Table'[Date Resolved] ) )
&& NOT ( ISBLANK ( 'Table'[Date Report Sent] ) ), "Report Sent",
NOT ( ISBLANK ( 'Table'[Date Received] ) )
&& NOT ( ISBLANK ( 'Table'[Date Evidence Sent] ) )
&& 'Table'[Date Evidence Sent] + 14
> TODAY (), "Sent to a Moderator",
NOT ( ISBLANK ( 'Table'[Date Received] ) )
&& NOT ( ISBLANK ( 'Table'[Date Evidence Sent] ) )
&& 'Table'[Date Evidence Sent] + 14
< TODAY (), "Report Overdue"
)
Espero que esto ayude
David
¡Muchas gracias por este @dedelman_clng! Funciona perfectamente con el conjunto de datos real Y me pensaste algo.
¡Eres un maldito LEGEND!
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 |