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
Danny-Happy
Helper I
Helper I

Ayuda con los cálculos "Ingresos por empleado"

Tengo una pregunta sobre algunos cálculos.

Tenemos varios proyectos con "Ingresos" y "Horas gastando" por empleado.

Esto es lo que obtenemos de nuestros datos:

Power BI - picture.PNG

Pero lo que realmente nos gustaría ver es:

Power BI - picture 2.PNG

Traté de calcular los ingresos por empleado por:

Ingresos por hora - dividir ( ingresos , horas )

Ingresos por empleado - Ingresos por hora * Horas

Desafortunadamente eso no funciona.

¿Puede ayudarnos a calcular los ingresos por empleado?

Gracias 🙂

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hola @Danny-Feliz ,

Puede crear medidas como DAX a continuación.

Percent Hour= 
DIVIDE (CALCULATE(SUM(Table1[Hours]),FILTER(ALLSELECTED(Table1), Table1[Project] =MAX(Table1[Project])&&Table1[Employee] =MAX(Table1[Employee]))), 
CALCULATE(SUM(Table1[Hours]),FILTER(ALLSELECTED(Table1), Table1[Project] =MAX(Table1[Project]))))



Percent Revenue= 
DIVIDE (CALCULATE(SUM(Table1[Revenue]),FILTER(ALLSELECTED(Table1), Table1[Project] =MAX(Table1[Project])&&Table1[Employee] =MAX(Table1[Employee]))), 
CALCULATE(SUM(Table1[Revenue]),FILTER(ALLSELECTED(Table1), Table1[Project] =MAX(Table1[Project]))))

Saludos

Amy

Equipo de apoyo a la comunidad _ Amy

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

4 REPLIES 4
v-xicai
Community Support
Community Support

Hola @Danny-Feliz ,

Puede crear medidas como DAX a continuación.

Percent Hour= 
DIVIDE (CALCULATE(SUM(Table1[Hours]),FILTER(ALLSELECTED(Table1), Table1[Project] =MAX(Table1[Project])&&Table1[Employee] =MAX(Table1[Employee]))), 
CALCULATE(SUM(Table1[Hours]),FILTER(ALLSELECTED(Table1), Table1[Project] =MAX(Table1[Project]))))



Percent Revenue= 
DIVIDE (CALCULATE(SUM(Table1[Revenue]),FILTER(ALLSELECTED(Table1), Table1[Project] =MAX(Table1[Project])&&Table1[Employee] =MAX(Table1[Employee]))), 
CALCULATE(SUM(Table1[Revenue]),FILTER(ALLSELECTED(Table1), Table1[Project] =MAX(Table1[Project]))))

Saludos

Amy

Equipo de apoyo a la comunidad _ Amy

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Muchas gracias, esto funciona de hecho.

Pero ahora tengo algunos problemas nuevos con los totales.

Power BI - picture.PNG

Como se puede ver el "Totaal" está mal de colum % Horas, sólo necesitamos lo siguiente:

Empleado de Ingresos : Ingresos de Totaal (17.823.115,71 por lo que sólo los totales del proyecto)
Empleado de valor de ingresos ( Revenuevalue Employee) Ingresos de Totaal (17.823.115,71 así que solo los totales del proyecto)

¿Es posible?

Gracias

FrankAT
Community Champion
Community Champion

Hola @Danny-Feliz

con su descripción y datos de muestra obtengo el siguiente resultado. Ambas medidas devuelven los mismos valores, es por sus datos:

23-09-_2020_14-36-01.png

Sum of Hours = SUM('Table'[Hours])

Sum of Revenue by Employee = SUM('Table'[Revenue by Employee])

Revenue per Employee = 
    DIVIDE([Sum of Revenue by Employee],CALCULATE([Sum of Revenue by Employee],ALL('Table')))

Revenue per Hour = 
    DIVIDE([Sum of Hours],CALCULATE([Sum of Hours],ALL('Table')))

Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

Thank you for your answer.

 

The following measure doesn't work because in "Table" there are more Projects, so the result of the measure is all written hours: 

 

Revenue per Hour =
DIVIDE([Sum of Hours],CALCULATE([Sum of Hours],ALL('Table')))

 

To show this I've made the following measure:

 

Revenue per Hour (basically this is all written hours no revenue) =
    CALCULATE(
        [hours] ,
        ALL( 'Fact - nacalculatie totaal' ) )
 
Solution:
Power BI - all hours.PNG
 
I can't use the following measure because I just have the revenue per project not per employee:
 
Revenue per Employee =
    DIVIDE([Sum of Revenue by Employee],CALCULATE([Sum of Revenue by Employee],ALL('Table')))
 
I need to calculate the revenue per employee first based on written hours.
 

 

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.