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
-Ozym4nd1az-
Helper I
Helper I

Problema de argumento de función TIME()

Hola

El siguiente DAX tiene un problema en la función 'Un argumento de la función 'TIME' tiene el tipo de datos incorrecto o el resultado es demasiado grande o demasiado pequeño'.

Este error aparece solo cuando presento (34200-(66600-(HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time]))))) en el argumento de la función TIME.

Realmente necesito este cálculo en el argumento de segundos... Probé muchas soluciones, pero nada funciona (traté de crear una función con variables y ellos hacen referencia a ella, sin éxito).

Columna de tiempo de respuesta máx.
if(CALCULATE(COUNT('Incident Data'[Priority]), 'Incident Data'[Priority] á "4 - Low") && (HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time]))>?59400 &&& ('Datos de incidentes'[Tiempo de reacción]+(HOUR('Datos de incidente'[Tiempo de apertura])*3600+MINUTE('Datos de incidente'[Tiempo de apertura])*60+SECOND('Datos de incidente'[Tiempo de apertura])))>66600, if(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((34200-(66600-(HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time]))))>0) , TIME(0,0,(34200-(66600-(HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time])))), TIME(0,0,0)),
if(CALCULATE(COUNT('Incident Data'[Priority]), 'Incident Data'[Priority] á "3 - Medium") && (HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time]))>?59400 &&& ('Datos de incidentes'[Tiempo de reacción]+(HOUR('Datos de incidente'[Tiempo de apertura])*3600+MINUTE('Datos de incidente'[Tiempo de apertura])*60+SECOND('Datos de incidente'[Tiempo de apertura])))>63000, if(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((30600-(66600-(HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time]))))>0) , TIEMPO(3,3,3), TIEMPO(0,0,0)),
if(CALCULATE(COUNT('Incident Data'[Priority]), 'Incident Data'[Priority] á "2 - High") && (HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time]))>?59400 &&& ('Datos de incidentes'[Tiempo de reacción]+(HOUR('Datos de incidente'[Tiempo de apertura])*3600+MINUTE('Datos de incidente'[Tiempo de apertura])*60+SECOND('Datos de incidente'[Tiempo de apertura])))>61200, if(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((28800-(66600-(HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time]))))>0) , TIEMPO (2,2,2), TIEMPO(0,0,0)),
if(CALCULATE(COUNT('Incident Data'[Priority]), 'Incident Data'[Priority] á "1 - Very High") &'& (HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time])>?59400 && ('Datos de incidentes'[Tiempo de reacción]+(HOUR('Datos de incidente'[Tiempo de apertura])*3600+MINUTE('Datos de incidente'[Tiempo de apertura])*60+SECOND('Datos de incidente'[Tiempo de apertura])))>60300, if(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((27900-(66600-(HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time]))))>0) ,TIME(1,1,1),TIME(0,0,0)),
if(CALCULATE(COUNT('Incident Data'[Priority]), 'Incident Data'[Priority] á "4 - Low"), [Next business time column]+ TIME(0,0,7200), if(CALCULATE(COUNT('Incident Data'[Priority]), 'Incident Data'[Priority] á "3 - Medium"), [Next business time column]+ TIME(0,0,0,3600), if(CALCULATE(COUNT('Incident Data'[Priority]), 'Incident Data'[Priority] á "2 - High"), [Next business time column]+ TIME(0,0,1800), if(CALCULATE(COUNT('Incident Data'[Priority]), 'Incident Data'[Priority] á "1 - Very High") , [Columna de la próxima hora comercial]+ TIEMPO(0,0,900), 0
))))))))
Ese es mi conjunto de datos, devuelve 04:04:04, 03:03:03, 02:02:02 y 01:01:01 en 'Columna de tiempo de respuesta máximo'.
pbi_doubt.png
¿Podría ayudarme?
2 REPLIES 2
lbendlin
Super User
Super User

Intenté poner esto en DAXFormatter.com pero no ayudó mucho.

Columna de tiempo de respuesta máx.
SI (
    CALCULAR (
        COUNT ( 'Datos de incidentes'[Prioridad] ),
        'Datos de incidentes'[Prioridad] - "4 - Bajo"
    )
        && (
            HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
        ) > 59400
        && (
            'Datos de incidentes'[Tiempo de reacción]
                + (
                    HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                        + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                        + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                )
        ) > 66600,
    SI (
         (
             (
                34200
                    - (
                        66600
                            - (
                                HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                                    + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                                    + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                            )
                    )
            ) > 0
        ),
        TIEMPO ( 0, 0, (
            34200
                - (
                    66600
                        - (
                            HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                                + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                                + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                        )
                )
        ) ),
        TIEMPO ( 0, 0, 0 )
    ),
    SI (
        CALCULAR (
            COUNT ( 'Datos de incidentes'[Prioridad] ),
            'Datos de incidentes'[Prioridad] - "3 - Medio"
        )
            && (
                HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                    + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                    + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
            ) > 59400
            && (
                'Datos de incidentes'[Tiempo de reacción]
                    + (
                        HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                            + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                            + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                    )
            ) > 63000,
        SI (
             (
                 (
                    30600
                        - (
                            66600
                                - (
                                    HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                                        + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                                        + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                                )
                        )
                ) > 0
            ),
            TIEMPO ( 3, 3, 3 ),
            TIEMPO ( 0, 0, 0 )
        ),
        SI (
            CALCULAR (
                COUNT ( 'Datos de incidentes'[Prioridad] ),
                'Datos de incidentes'[Prioridad] - "2 - Alto"
            )
                && (
                    HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                        + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                        + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                ) > 59400
                && (
                    'Datos de incidentes'[Tiempo de reacción]
                        + (
                            HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                                + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                                + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                        )
                ) > 61200,
            SI (
                 (
                     (
                        28800
                            - (
                                66600
                                    - (
                                        HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                                            + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                                            + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                                    )
                            )
                    ) > 0
                ),
                TIEMPO ( 2, 2, 2 ),
                TIEMPO ( 0, 0, 0 )
            ),
            SI (
                CALCULAR (
                    COUNT ( 'Datos de incidentes'[Prioridad] ),
                    'Datos de incidentes'[Prioridad] - "1 - Muy Alto"
                )
                    && (
                        HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                            + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                            + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                    ) > 59400
                    && (
                        'Datos de incidentes'[Tiempo de reacción]
                            + (
                                HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600                                    + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                                    + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                            )
                    ) > 60300,
                SI (
                     (
                         (
                            27900
                                - (
                                    66600
                                        - (
                                            HORA ( 'Datos de incidente'[Tiempo de apertura] ) * 3600
                                                + MINUTO ( 'Datos de incidente'[Tiempo de apertura] ) * 60
                                                + SEGUNDO ( 'Datos de incidente'[Tiempo de apertura] )
                                        )
                                )
                        ) > 0
                    ),
                    TIEMPO ( 1, 1, 1 ),
                    TIEMPO ( 0, 0, 0 )
                ),
                SI (
                    CALCULAR (
                        COUNT ( 'Datos de incidentes'[Prioridad] ),
                        'Datos de incidentes'[Prioridad] - "4 - Bajo"
                    ),
                    [Próxima columna de tiempo de negocios] + TIEMPO ( 0, 0, 7200 ),
                    SI (
                        CALCULAR (
                            COUNT ( 'Datos de incidentes'[Prioridad] ),
                            'Datos de incidentes'[Prioridad] - "3 - Medio"
                        ),
                        [Próxima columna de tiempo de negocios] + TIEMPO ( 0, 0, 3600 ),
                        SI (
                            CALCULAR (
                                COUNT ( 'Datos de incidentes'[Prioridad] ),
                                'Datos de incidentes'[Prioridad] - "2 - Alto"
                            ),
                            [Próxima columna de tiempo de negocios] + TIEMPO ( 0, 0, 1800 ),
                            SI (
                                CALCULAR (
                                    COUNT ( 'Datos de incidentes'[Prioridad] ),
                                    'Datos de incidentes'[Prioridad] - "1 - Muy Alto"
                                ),
                                [Próxima columna de tiempo de negocios] + TIEMPO ( 0, 0, 900 ),
                                0
                            )
                        )
                    )
                )
            )
        )
    )
)

¿Puedes explicar lo que estás tratando de medir?

Hola Ibendlin,

Tengo un cálculo que está contando cuántos segundos del pasado día de biz queda para la mañana del día siguiente, teniendo en cuenta la gravedad de los incidentes y si se abrieron antes de la hora debida hasta el final del día. Por ejemplo, si un incidente es sev. 2 (2 horas para el tiempo de reacción), y se abre después de 16h30 (16h44 por ejemplo), debo añadir 14 minutos a la respuesta de tiempo máximo por lo que debe ser 7h44.

He depurado el código y todo funciona. Excepto por la función TIME con el argumento para este cálculo. Este cálculo a continuación me devuelve el tiempo restante. Una condición antes asegura que si la hora es negativa se registra 00:00:00 y ellos puedo como 'incumplido'.

Normalmente TIME() está aceptando cualquier número como argumento en segundos (por ejemplo, 28959) y convirtiéndolo en tiempo de datos. Sin embargo, cuando inserto el cálculo a continuación para él, simplemente no acepta como argumento. y el azulejo se rompe. Por lo tanto, esa es la razón por la que estoy usando TIME(2,2,2) en alguna parte de código, sólo para depurar. Necesito hacer posible que TIME(), acepte de alguna manera esta función anterior (que devuelve un número en segundos también!).

34200-(66600-(HOUR('Incident Data'[Open time])*3600+MINUTE('Incident Data'[Open time])*60+SECOND('Incident Data'[Open time])))

Br

Pedro

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.