Determine Which Employees Have Worked 13 Weeks Consecutively

SimonNU

Board Regular
Joined
Jul 11, 2013
Messages
140
Hi guys

I'm at a bit of a loss as to how to calculate this. Usually I can give it a good shot but this is quite a weird one...

I have the below model:

Fact Table:
Employee | Date | Hours

Date Table:
Date | YYYYWW

The question: How would I determine which employees have worked 13 weeks consecutively and which have not? Ideally this would be a calculated column but if it's possible to do in a measure then that's fine too!


Thanks!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How about doing a distinct count over a filter of the last 13 weeks. If the answer is 13, then they worked all 13.
You should add an ID column to your date table.

Something like this.

=if(calculate(distinctcount(employee), filter(all(date table), datetable[id] >= min(datetable[id])-12 && datetable[id] <= max(datetable[id])))=13,"true","false")

you our can read about ID columns here. Power Pivot Calendar Tables -
 
Upvote 0
Thanks Matt.

The 13 weeks would relate to the current filter though, wouldn't it? Maybe there's something i'm not understanding but it looks like I would have to manually iterate through every week and note down which employees satisfied the criteria. Unfortunately this is unfeasible because my data spans several years and thousands of people.
 
Upvote 0

Forum statistics

Threads
1,224,112
Messages
6,176,445
Members
452,728
Latest member
mihael546

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top