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
Anonymous
Not applicable

Transformar fórmula (Tableau > PBI)

Necesito transformar la fórmula siguiente de Tableau a Power BI.

IF - FIXED DATETRUNC('hour', [Date of call]), [Professional] : SUM([Número de llamadas]) - 0 ENTONCES 100 ELSEIF
• FIXED DATETRUNC('hour', [Date of call]), [Professional] :SUM([Número de llamadas])
• FIXED DATETRUNC('hour', [Date of call]), [Professional] :SUM([Número de llamadas]) ? 2 ENTONCES 100 ELSEIF
• FIXED DATETRUNC('hour', [Date of call]), [Professional] :SUM([Número de llamadas]) ? 3 ENTONCES 125 ELSEIF
• FIXED DATETRUNC('hour', [Date of call]), [Professional] :SUM([Número de llamadas]) ? 4 ENTONCES 150 ELSEIF
• FIXED DATETRUNC('hour', [Date of call]), [Professional] :SUM([Número de llamadas]) - 5 ENTONCES 175 ELSEIF
• FIXED DATETRUNC('hour', [Date of call]), [Professional] :SUM([Número de llamadas]) ? 6 ENTONCES 200 ELSEIF
• FIXED DATETRUNC('hour', [Date of call]), [Professional] :SUM([Número de llamadas]) ? 7 ENTONCES 225 ELSEIF
• FIXED DATETRUNC('hour', [Date of call]), [Professional] :SUM([Número de llamadas]) ? >- 8 ENTONCES 250 ELSE
0o extremo
Gracias.
1 ACCEPTED SOLUTION

Hola @Fabricio_dDP,

¿Quiere decir que desea obtener el número de registros de la categoría actual en una hora? Si se trata de un caso, puede extraer la fecha y hora actuales con la categoría actual para calcular el recuento.

Measure =
VAR currDate =
    MAX ( table[Data do atendimento] )
VAR _count =
    CALCULATE (
        COUNTROWS ( table ),
        FILTER (
            ALLSELECTED ( table ),
            DATEVALUE ( [Data do atendimento] ) = DATEVALUE ( currDate )
                && HOUR ( [Data do atendimento] ) = HOUR ( curDate )
        ),
        VALUES ( table[Profissional] )
    )
RETURN
    SWITCH ( _count, 2, 100, 3, 125)

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

6 REPLIES 6
harshnathani
Community Champion
Community Champion

Hola @Fabricio_dDP ,

Puede intentar utilizar la instrucción SWITCH () aquí.

Vea este video sobre cómo utilizar la instrucción SWITCH().

https://www.youtube.com/watch?v=-ykkaAtlCMc&vl=en

saludos
Harsh Nathani
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución! Apreciar con un Kudos!! (Haga clic en el botón Pulgares arriba)

Anonymous
Not applicable

Hola @harshnathani,
Gracias por la respuesta.
El problema es que tengo que calcular cuántas llamadas el [Profissional] hizo en 1 hora, y luego aplicar la condición. Si [Profissional] asiste a 2 en una hora (100) y 2 en una hora (125) ...


Tengo esta información para trabajar:

ProfesionalFecha de servicio
Xxx...09/08/2020 15:33
Yyy...09/08/2020 20:56
Xxx...09/08/2020 18:53
Yyy...09/08/2020 19:25
Xxx...09/08/2020 19:10
Xxx...09/08/2020 20:49




saludos
Fabricio de Dominicis

Anonymous
Not applicable

Hola @harshnathani
¿Es posible hacerlo en Power BI?

saludos
Fabrício de Dominicis

Hola @Fabricio_dDP,

¿Quiere decir que desea obtener el número de registros de la categoría actual en una hora? Si se trata de un caso, puede extraer la fecha y hora actuales con la categoría actual para calcular el recuento.

Measure =
VAR currDate =
    MAX ( table[Data do atendimento] )
VAR _count =
    CALCULATE (
        COUNTROWS ( table ),
        FILTER (
            ALLSELECTED ( table ),
            DATEVALUE ( [Data do atendimento] ) = DATEVALUE ( currDate )
                && HOUR ( [Data do atendimento] ) = HOUR ( curDate )
        ),
        VALUES ( table[Profissional] )
    )
RETURN
    SWITCH ( _count, 2, 100, 3, 125)

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

@v-shex-msft
Eso funcionó.

¡Gracias!

saludos
Fabricio

Anonymous
Not applicable

Hola harshnathani,
Gracias por la respuesta.
El problema es que tengo que calcular cuántas llamadas el [Professonal] hizo en 1 hora, y luego aplicar la condición.

saludos

Fabricio de Dominicis

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.