Forum Discussion
tobiasmcbride
Helper III
6 years agoNumber at a particular date
Hi, I have the following data on headcount. Name Position Start Date End Date Current Status Joe Bloggsd Head of Marketing 21/02/2017 Established Noah Anyone Head of Opera...
Anonymous
6 years agoNot applicable
You need a date dimension, look at my suggestion here
- tobiasmcbride6 years ago
Helper III
That won't work as it needs to be able to have a particular date and then say on that date how many did we have in the firm (i.e. whose start date and end date, latter if applicable coincided with it).
- Anonymous6 years agoNot applicable
ok in any case add a date dimension and add a slicer on the top with the date
Now you have your date you want to analyze withCurrentDate=SELECTEDVALUE(YourDateTable[Date])
Now your measure will beEmployeesAtThatDate= Var CurrentDate=SELECTEDVALUE(YourDateDim[Date]) RETURN COUNTROWS( FILTER(Employees;Employees[StartDate]<=CurrentDate && Employees[EndDate]>=CurrentDate))As I'm writing on the fly and I don't remember you mihgt have to use
EmployeesAtThatDate= Var CurrentDate=SELECTEDVALUE(YourDateDim[Date]) RETURN CALCULATE(COUNTROWS(Employees);FILTER(Employees;Employees[StartDate]<=CurrentDate && Employees[EndDate]>=CurrentDate))