Forum Discussion
Divyanshkapoor
3 years agoNew Member
need dax help
Scenario: I have a report that needs me to calculate the frequency of absenteeism impact per employee. The condition is, 1 date will be count as 1, and consecutive date will also be count as 1. If t...
Mehdi_Rizvi
Advocate I
3 years agoYou can try this DAX :
Absenteeism Frequency =
VAR PreviousDate = MIN('YourTable'[Date]) - 1
RETURN
SUMX(
FILTER('YourTable',
'YourTable'[Employee] = SELECTEDVALUE('YourTable'[Employee]) &&
('YourTable'[Date] - PreviousDate > 1 ||
WEEKNUM('YourTable'[Date]) <> WEEKNUM(PreviousDate))
),
1
)