Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.