cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cmccully
Helper I
Helper I

Display employee with highest labor for each category

I have a report that will display the highest labor time for each category. I also want to be able to display the employee name associated with that entry.

 

What I am hoping for is a visual similar to the middle one on the bottom that shows each category and then shows the employee name that coresponds to the highest labor entry for each filtered category. I dont really care if the visual is a table or a graph as long as I can display the category and a name.

 

2019-12-03_13-12-21.jpg

 

 

 

 

 

 

 

Here is a link to my pbix file: 

PMB Average Time By Category 

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

HI @cmccully ,

 

Create a measure like below to get the employee name whose labor hour is highest among rest.

Top Employee = MAXX(TOPN(1,VALUES(Query1[EMPLOYEE_NAME]),CALCULATE(Sum(Query1[LABOR_HOURS])),DESC),Query1[EMPLOYEE_NAME])
 
Please give THUMPS UP for support and also mark this as a solution so other can take help from it.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , and Fortune 500 Companies Analysis

View solution in original post

3 REPLIES 3
Tahreem24
Super User
Super User

HI @cmccully ,

 

Create a measure like below to get the employee name whose labor hour is highest among rest.

Top Employee = MAXX(TOPN(1,VALUES(Query1[EMPLOYEE_NAME]),CALCULATE(Sum(Query1[LABOR_HOURS])),DESC),Query1[EMPLOYEE_NAME])
 
Please give THUMPS UP for support and also mark this as a solution so other can take help from it.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , and Fortune 500 Companies Analysis

View solution in original post

That worked perfectly, thank you!

 

Can you walk me through the DAX expression? I am trying to learn but still find DAX pretty confusing.

Hi @cmccully ,

 

Top Employee = MAXX(TOPN(1,VALUES(Query1[EMPLOYEE_NAME]),CALCULATE(Sum(Query1[LABOR_HOURS])),DESC),Query1[EMPLOYEE_NAME])

 

Basically TOPN function is used to give to top N rows from specified table. In your scenario I put 1 as a first parameter of TOPN so it will return top 1 value of emplyee whose labor hour is highest among rest employee. 

TOPN function basically return result in the form of table so put this into MAXX function as a first parameter cause it will iterate thorugh the entire table and return the value specfied in second parameter of MAXX i.e. Employee name.

 

I will really appreciate your KUDOS for support!

Thanks!

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , and Fortune 500 Companies Analysis

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors