I'm having a lot of issue working out the Dax formula for the following. I have a table and shows employees and any days that they have taken sick from work. e.g.
|Employee ID||Day taken sick|
For each employee - i need to flag (some how - i dont care how) - where they have had a period of 4 sickdays that fall within a 6 week period. For example - from my table above - the following all fall within a 6 week period for employee A:
and so I need to flag these somehow and pull out the dates. I don't mind how.
No date should be used twice though - so once a date has been flagged as part of a 4 instance within 6 week series - then they should not be used again in another 4 instance within 6 week series....as such the dates should be used in date order (earliest to latest)
Please let me know if you can help
Hi, try this as a calculated column:
Count sick days within 6 weeks = VAR CurrentDateToCheckMin = SickDates[Day taken sick] VAR CurrentDateToCheckMax = SickDates[Day taken sick]+6*7 VAR EmployeeID = SickDates[Employee ID] RETURN CALCULATE(COUNTROWS(SickDates);FILTER(SickDates;SickDates[Day taken sick]<CurrentDateToCheckMax && SickDates[Day taken sick]>CurrentDateToCheckMin);SickDates[Employee ID]=EmployeeID)+1
I don't have the same date formats as you though.
Then you can highlight one of the dates in the intervals by filtering with value 4 or more.
Does that make sense? If so, kindly mark the answer as solution to close the case.