hmltnangel
Active Member
- Joined
- Aug 25, 2010
- Messages
- 290
- Office Version
- 365
- Platform
- Windows
Hi all. I have tried a few different route for this one, and cant quite get it right. I am hopeful you kind people will fix this.
I have a Date/Calendar table created called "Date" with a column of dates. I have a table with all staff data contained in it, called StaffCounts. This contains columns for "Name", "Start Date", "End Date".
I want to be able to count how many people were employed on a specific date that I can select via filters, or Slicers.
The code I have used is as follows: (basically an adaptation of this - Open Tickets)
Now what I think is happening, is that its counting how many people started on a filtered date, rather than the number of people employed on a set date. Any suggestions?
I have a Date/Calendar table created called "Date" with a column of dates. I have a table with all staff data contained in it, called StaffCounts. This contains columns for "Name", "Start Date", "End Date".
I want to be able to count how many people were employed on a specific date that I can select via filters, or Slicers.
The code I have used is as follows: (basically an adaptation of this - Open Tickets)
Code:
Staff on Date =
CALCULATE(
COUNTROWS(staffcounts),
FILTER(
staffcounts,
STAFFcounts[Current Employment: Start Date] <= MAX('Date'[Date]) &&
(staffmaster[Current Employment: end date] >= MAX('Date'[Date]) || ISBLANK(staffcounts[Current Employment: end date]))
)
)
Now what I think is happening, is that its counting how many people started on a filtered date, rather than the number of people employed on a set date. Any suggestions?