Counting # of instances in a period where criteria used evaluates multiple records and fields for a single instance

ollieotis

New Member
Joined
Jun 6, 2006
Messages
45
Hello,

I am trying to calculate the number of times an instance occurs in timesheet data, where an instance is defined as:

Per Day: >= 3 Employees from same Department worked on same Customer Account, and >=3 of same Employees worked >2 hours each. In other words, I am looking to identify where potentially department time has been applied 3x in a day to a customer account.

The table has ~500k records and has multiple other columns, but is basically setup as follows:

DateDepartmentCustomerEmployeeHours
1/4/2025HomeABCDoe, Jane4
1/5/2025AwayXYZDoe, John2
1/4/2025HomeABCSmith, John3
1/4/2025HomeABCJones, Sam3

In the above data, this would calculate as one instance as Home Department employees Jane Doe, John Smith, and Sam Jones all worked >2 hours on the same customer in a single day.

I got as far as the following measure, but it only provides me with a count of instances where an employee has worked more than 2 hours:

COUNTROWS ( FILTER ( SUMMARIZE (Timesheets , Timesheets[Date] , Timesheets[Department] , Query [Customer] , Timesheets[Name] , "Instance Hours" , sum ( Timesheets[Hours] )) , [Instance Hours]>=2))

I'm stuck at how to incorporate the other logic needed into this measure.

Any advice would be much appreciated.

Thanks in advance!
 

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