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
sdas028
Helper I
Helper I

Average Head Count by Week

Hi, I am trying to calculate average head count by ISOWEEK. I have a data table that contains employee number, employee name, date of shift, position, isoweek. As the data has an inidvidual line for each employee on each day, if I do a count there is for example 20 heads based on 4 people working 5 days a week, and DISTINCTCOUNT gives 4 heads, but that is not the average of the heads. I've tried using an average and distinctcount combination but that doesnt seem to work either. Any suggestions?

1 ACCEPTED SOLUTION

Hi @sdas028,

You should use the following formula and check if it works fine.

average=COUNTROWS(Table)/DISTINCTCOUNT(Table[Emplyeename])


Best Regards,
Angelia


View solution in original post

8 REPLIES 8
Seward12533
Solution Sage
Solution Sage

Wim need more information to help. At least Picture of data model and some representative data if not a link to copy of a sample workbook.

Hi

 

Here is a sample lot of the data I have, there is employee name and position as well but didnt want to include that information

 

 

 

Employee NumberHours WorkedDateIsoweek
50172530/04/201818
504373.7530/04/201818
507113.7530/04/201818
5005510.251/05/201818
5043711.251/05/201818
5071111.251/05/201818
5112411.51/05/201818
50055112/05/201818
5017212.752/05/201818
5043711.52/05/201818
5071111.752/05/201818
5112411.752/05/201818
500557.53/05/201818
5017213.253/05/201818
5043713.253/05/201818
5071111.253/05/201818
51124143/05/201818
5005594/05/201818
50172114/05/201818
504379.754/05/201818
5112410.254/05/201818
50055105/05/201818
5017211.755/05/201818
5071110.755/05/201818
511246.755/05/201818
500558.56/05/201818
5017211.256/05/201818
5043710.56/05/201818
5071110.56/05/201818
50172127/05/201819
5043710.257/05/201819
5071112.57/05/201819
500558.758/05/201819
5043788/05/201819
5071198/05/201819
5112478/05/201819
5005511.59/05/201819
5017212.59/05/201819
5043711.259/05/201819
50711139/05/201819
51124119/05/201819
500557.510/05/201819
5017210.2510/05/201819
504379.510/05/201819
507111110/05/201819
500557.511/05/201819
5017210.2511/05/201819
504379.7511/05/201819
51124911/05/201819
500558.7512/05/201819
50172912/05/201819
507115.2512/05/201819
51124412/05/201819
504371014/05/201820
501727.7515/05/201820
504378.2515/05/201820
507118.7515/05/201820
501729.7516/05/201820
504371016/05/201820
507119.7516/05/201820
500557.517/05/201820
501728.517/05/201820
504378.517/05/201820
50711917/05/201820
500557.518/05/201820
5043710.2518/05/201820
500559.2519/05/201820
501729.519/05/201820
507111019/05/201820
50055720/05/201820
50172920/05/201820
504378.7520/05/201820
507119.2520/05/201820
5017210.7521/05/201821
5071110.7521/05/201821
500557.522/05/201821
504371222/05/201821
5071110.7522/05/201821
500551.7523/05/201821
50172323/05/201821
50437223/05/201821
507112.2523/05/201821
501728.524/05/201821
504377.7524/05/201821
507117.524/05/201821
504376.525/05/201821
500559.526/05/201821
5017210.526/05/201821
507119.7526/05/201821
5005513.2527/05/201821
5017213.2527/05/201821
504371227/05/201821
507116.527/05/201821

Sample.PNGIs this what is required as output ?

I have managed to also get to this table - however I would have thought that the average for week 21 should be 5? 20 shifts in one week worked by 4 people should give an average of 5, or perhaps I am incorrect in my thinking and possibly overthinking the calculation

Is week 21 a complete or partial week?

Do you mean did they work a full week?

Hi @sdas028,

You should use the following formula and check if it works fine.

average=COUNTROWS(Table)/DISTINCTCOUNT(Table[Emplyeename])


Best Regards,
Angelia


Brilliant!

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.