Forum Discussion

a_guest1005's avatar
a_guest1005
Frequent Visitor
3 years ago
Solved

Measure with Summarize

Hi,

I've got a detail absence table with start and enddate and the number of sick days for that absence. In order to fnd out if the employee is LTS I've summarised the data.

 

The absence table is linked to the date table on Absence End date.

 

If I have an employee that starts the absence in Nov and has 17 days off and continues to be off until Mid Dec - having 10 days off. The total for the absence is 27 days and therefore the employee is considered LTS for Dec and potentiallay going forward.

 

At the moment, the below is giving me 0 for LTS for both mths.

 

How do I amend the code below to provide what I need? 


TIA

 

 

 Filter(
                SUMMARIZE(factAbsence,
                            factAbsence[EmployeeID], factAbsence[AbsenceGroupUID],
                            "GroupStartDate", min(factAbsence[AbsenceStartDate]),
                            "GroupEndDate", max(factAbsence[AbsenceEndDate]),
                            "Total Sick Days", sum(factAbsence[Total Sick Days]),
                            "LTSID", IF(SUM(factAbsence[Total Sick Days]) > 20, 1 , 0)
                        ),
                        Not ISBLANK([Total Sick Days]))-- Removes weekend Days start and end dates
                , [LTSID] )

1 Reply