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
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 , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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 , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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 , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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.