Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filtering a measure

Hi All,   I have a measure which calculates the 12 month rolling headcount from an employee file. Measure as below.   However, i need it to exclude certain "Contract Types" so i have a field call...
  • Samarth_18's avatar
    4 years ago

    Hi Anonymous ,

     

    You can try like this:-

    Rolling 12 month HC =
    CALCULATE (
        COUNT ( 'HC'[Employee ID] ),
        DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -12, MONTH ),
        FILTER (
            'table',
            table[Contract Type]
                IN { "Perm", "Fix" }
                && table[Contract Type] <> Agency
        )
    )

     

    Thanks,

    Samarth