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, and Sales Analysis Report

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, and Sales Analysis Report

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, and Sales Analysis Report

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.