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
Anonymous
Not applicable

Calculate weekly average of hours worked per user (updated with working measure,need help improving)

Edit!!

 

I kinda got it working now. I added a calculated column to sum up each person's daily hours, into a week total. 

 

Calculated Column- sum each person hours by week:

 

Week Total AVG p/TL = CALCULATE(SUM(Merged_August_forward[Total Phone Time Hours]), ALLEXCEPT(Merged_August_forward, Merged_August_forward[TeamLeads_Hierarchy_Table_Table.AGENT_NAME] ,Merged_August_forward[Date]))

 

Then i added a measure to average those weekly totals

 

Measure:

 

Week Total Overall AVG =



AVERAGEX(

    GROUPBY(Merged_August_forward, Merged_August_forward[Week of Year], Merged_August_forward[TeamLeads_Hierarchy_Table_Table.AGENT_NAME]),

    CALCULATE(SUM('Merged_August_forward'[Week Total AVG p/TL]))

)

Its probably not the most elegant way to do this. but it's at least giving me the desired output. I need this to exclude zeros but i have not been able to make <>0, FILTER to work. I'm using a page level filter to greater than zero for now. any ideas on making this more efficient/cleaner and exclude zeros?

2 REPLIES 2
HotChilli
Super User
Super User

Please post some data (not a picture) and your desired outcome. Somebody will help you.

Anonymous
Not applicable

ManagerAgentWork HoursDateStart of Week

Jayson Costa

Esteban Riddle

38/12/2019 0:008/11/2019 0:00

Jayson Costa

Keely Liu

58/5/2019 0:008/4/2019 0:00

Jayson Costa

Alejandro Mckenzie

18/6/2019 0:008/4/2019 0:00

Jayson Costa

Addisyn Richards

48/7/2019 0:008/4/2019 0:00

Jayson Costa

Paulina Horn

88/8/2019 0:008/4/2019 0:00

Jayson Costa

Esteban Riddle

78/9/2019 0:008/4/2019 0:00

Jayson Costa

Keely Liu

18/12/2019 0:008/11/2019 0:00

Jayson Costa

Alejandro Mckenzie

48/5/2019 0:008/4/2019 0:00

Jayson Costa

Addisyn Richards

18/6/2019 0:008/4/2019 0:00

Jayson Costa

Paulina Horn

58/9/2019 0:008/4/2019 0:00

Titus Lee

Malakai Spencer

18/12/2019 0:008/11/2019 0:00

Titus Lee

Britney Noble

78/14/2019 0:008/11/2019 0:00

Titus Lee

Ellie Avery

88/5/2019 0:008/4/2019 0:00

Titus Lee

Helena Chen

88/6/2019 0:008/4/2019 0:00

Titus Lee

Jagger Giles

48/7/2019 0:008/4/2019 0:00

Titus Lee

Malakai Spencer

28/8/2019 0:008/4/2019 0:00

Titus Lee

Britney Noble

68/9/2019 0:008/4/2019 0:00

Titus Lee

Ellie Avery

58/12/2019 0:008/11/2019 0:00

Titus Lee

Helena Chen

78/13/2019 0:008/11/2019 0:00

Titus Lee

Jagger Giles

68/14/2019 0:008/11/2019 0:00

Chris Deleon

Kaleigh Riddle

38/15/2019 0:008/11/2019 0:00

Chris Deleon

Rayne Suarez

58/5/2019 0:008/4/2019 0:00

Chris Deleon

Antoine Guerra

88/6/2019 0:008/4/2019 0:00

Chris Deleon

Aaron Rivas

38/7/2019 0:008/4/2019 0:00

Chris Deleon

Brady Carney

28/8/2019 0:008/4/2019 0:00

Chris Deleon

Jayleen Reyes

78/9/2019 0:008/4/2019 0:00

Chris Deleon

Kaleigh Riddle

58/13/2019 0:008/11/2019 0:00

Chris Deleon

Rayne Suarez

58/14/2019 0:008/11/2019 0:00

Chris Deleon

Antoine Guerra

48/15/2019 0:008/11/2019 0:00

Chris Deleon

Aaron Rivas

58/5/2019 0:008/4/2019 0:00

Chris Deleon

Brady Carney

58/8/2019 0:008/4/2019 0:00

Chris Deleon

Jayleen Reyes

18/12/2019 0:008/11/2019 0:00

 

Week of 8/4    
ChrisAVG 7 hours per agent wkly7  
JaysonAVG 7 hours per agent wkly7  
TitusAVG 5.6 hours per agent wkly5.6  
     
Week of 8/11    
Chris4.5 hours per agent wkly4.5  
Jayson2 hours per agent wkly2  
Titus5.2 hours per agent wkly5.2  
     
     
I need to display    
 the rolling average per manager (last 3)Chris AVG (7,4.5) 5.75since example only has 2 weeks
the overal current AVG per managerChris AVG (7,4.5) 5.75since example only has 2 weeks
     
the overal current AVG (from agent level)(8/4 - 6.53 AVG; 8/11 - 4.36 AVG5.445example only has 2 weeks, I have 2 years worth
 the rolling overal average(last 3)(from agent level) 5.445  
     
there is a 3rd category of leader above manager, would need the same averages for them too   

Hope this table helps.  i can share an excel of the same if needed. 

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.