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
byWing
Frequent Visitor

Help!~ Average hours per person by task

Hi all,

 

I am still new to PowerBI so DAX is overwhelming to me. I am not sure do i start with calculate or average first... =(

 

I am trying to calculate the average hours per person spent on the task "Operation" for each place. 

 

Objective is to plot a bar chart of:

y-axis: average hours per person on task "Operation"

x-axis: Place

 

Below is my sample data:

byWing_1-1678762434244.png


Your help is much appreciated.

 

Thank you very much!

 

4 REPLIES 4
BrianConnelly
Resolver III
Resolver III

Try the following which calculates the average hours per person, broken into variables for easy to read the steps..

 

 

Average Hours Per Person =
VAR filteredOperations = FILTER(Table, Task = "Operations)
VAR averageHoursPerPerson = SUMMARIZE(filteredOperations,Table[Person],"Avg.Hours",AVERAGE(Table[Hour]))
VAR averageHours = AverageX(averageHoursPerPerson, [Avg.Hours])

RETURN averageHours 

 

 

 

byWing
Frequent Visitor

hi All,

 

I am still struggling with this. Would anyone be able to help please?

 

Thank you so much~

amitchandak
Super User
Super User

@byWing , Try a measure like

averageX(Values(Table[Person]) , calculate(Sum(Table[Hour/month]), filter(Table, Table[Task] = "Opeartions")))

Hi @amitchandak 

Thank you for your reply.

I tried your suggestion but I am not sure what is wrong:

byWing_1-1678869812973.png

 

Would appreciate your advice pls. Thank you for your help~

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.