Forum Discussion
Date Slicer Modifying Employee List Based on Hire/Termination Date
- 2 years ago
That's a standard "measure as visual filter" pattern. Create a measure that returns 1 for a given employee and date if the date falls between hire and termination, and 0 otherwise. Then in the visual where you list the employees set the visual filter to the measure being equal to 1.
- Anonymous2 years ago
Hi Scientist324
Thank you very much lbendlin for your prompt reply. Allow me to add some details.
“Employee”
Create a measure. Determine if the employee is employed within the scope of the slicer.
Measure = var _mindate = MIN('Date'[Date]) var _maxdate = MAX('Date'[Date]) var _hiredate = SELECTEDVALUE('Employee'[hire dates]) var _terminationdate = SELECTEDVALUE('Employee'[termination dates]) RETURN IF( (_hiredate >= _mindate && _hiredate <= _maxdate) && (_terminationdate <= _maxdate && NOT(ISBLANK(_terminationdate))) , 1, 0 )Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
That's a standard "measure as visual filter" pattern. Create a measure that returns 1 for a given employee and date if the date falls between hire and termination, and 0 otherwise. Then in the visual where you list the employees set the visual filter to the measure being equal to 1.
- Scientist3242 years agoRegular VisitorTried this measure and I am getting an error from using two different tables.
IF(('Employee Table'[Hire Date])<(MIN('Calendar'[Date])&&('Employee Table'[Terminate Date])>(MAX('Calendar'[Date]),"1","0")))