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
dgkallan
Helper II
Helper II

Hourly Rate Differential

I have a table that generally looks like the below:

 

EmployeeHourly RateRoleRaceGenderTenure years
A$18.50ICU RN

White

Female1.25
B$17.00ICU RNBlackFemale2.5
C$16.50ICU RNAsianMale1.75

 

There are obviously more employees with different roles and a variety more races, however this is a sample.

 

Here's what I'm trying to accomplish.  I first want to establish a salary differential within a job role, which is essentially comparing an hourly rate to the average within the Role.  The average above would be $17.33, so Employee A would have a salary differential of 1.06 and Employee C would have a salary differential of .95.  

 

I then want to be able to take that salary differential and use the Key Influencers visual to be to look at race, gender, tenure, and a few other factors to see what influence those have on the salary differential.  

 

I'm struggling with the approach.  Does I start with some sort of measure, or a column, or a build a table of averages?  For some reason, I just can't wrap my head around this one.  

 

 

1 ACCEPTED SOLUTION

This worked, except the SUM needed to be removed from the second column.  

 

Average Hourly Rate by Role =
CALCULATE(
    AVERAGE('Table'[Hourly Rate]),
    ALLEXCEPT('Table''Table'[Role])
)
 
Job Profile Hourly Differential =
DIVIDE('Table'[Hourly Rate],
    CALCULATE(
        AVERAGE('Table'[Hourly Rate]),
        ALLEXCEPT('Table','Table'[Role])
        )
    ,0
)

View solution in original post

6 REPLIES 6
Daniel29195
Super User
Super User

@dgkallan 

 

to calculate the average in this table  you can use this measure : 

option1 : 

average = 
calculate (

  average(table_name[col_num] ) ,

all(table_name) ,

values( table_name[role_name])

 

 

option2 : 

average = 
calculate (

  average(table_name[col_num] ) ,

allselected(table_name),

values( table_name[role_name])

 

 

the difference between the 2 options, is that option1 will not take into consiedartion slicers and filters , 

however option2 will caluclate your measure taking into consideration the slicers and filters you apply.

 

having the average, i guess you can now do the logic you want base on the business logic.

 

 

 

 

 

If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍

Thank you.  This did not give an expected average by job profile - I'm assuming it gave an average of all hourly salaries. 

amustafa
Super User
Super User

To start with, create two measures in your table and see if that helps. You need more than 3 columns to analyse key influencers.

 

Average Hourly Rate by Role =
CALCULATE(
    AVERAGE('Table'[Hourly Rate]),
    ALLEXCEPT('Table', 'Table'[Role])
)
 
Salary Differential =
DIVIDE(
    SUM('Table'[Hourly Rate]),
    CALCULATE(
        AVERAGE('Table'[Hourly Rate]),
        ALLEXCEPT('Table', 'Table'[Role])
    )
)
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Give a pig a pancake...:)

 

So, I have the average within the role and a differential.  How would you then calculate the spread in the differential to figure out which roles have the most variance?

I tried using 

CALCULATE(
    MAX(dimWorker[Job Profile Hourly Differential]),
    ALLEXCEPT(dimWorker,dimJobFamily[Job Profile])
)
CALCULATE(
    MIN(dimWorker[Job Profile Hourly Differential]),
    ALLEXCEPT(dimWorker,dimJobFamily[Job Profile])
)
 
 
I got only the Max result so I split into two columns using the same DAX above.  As you can see, the Max works, but the Min returns a 0.  Very strange....any ideas?
MAX Result:
EmployeeDifferentialMaxMin
A.881.040.00
B1.041.040.00
C1.041.040.00
D1.041.040.00
E.991.040.00
F.991.040.00
G.991.040.00
H1.041.040.00
I.971.040.00
    
Any ideas?  This is very strange that one would work and not the other.

This worked, except the SUM needed to be removed from the second column.  

 

Average Hourly Rate by Role =
CALCULATE(
    AVERAGE('Table'[Hourly Rate]),
    ALLEXCEPT('Table''Table'[Role])
)
 
Job Profile Hourly Differential =
DIVIDE('Table'[Hourly Rate],
    CALCULATE(
        AVERAGE('Table'[Hourly Rate]),
        ALLEXCEPT('Table','Table'[Role])
        )
    ,0
)

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.