Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Help With Missing Timesheet Counts

Hello everyone,   I need some help with a Missing Timesheet report that I'm doing for my company. Basically, I have 2 tables that have a 1-to-many relationship: Employee List - table of employee ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

    Please update the formula of measure "Missing count" as below:

    Missing Count = 
    VAR _selections =
        ALLSELECTED ( 'Timesheet Hours'[Period Name] )
    VAR _countofPeriod =
        COUNTROWS ( _selections )
    RETURN
        CALCULATE (
            DISTINCTCOUNT ( 'Employee List'[Employee Name] ),
            'Employee List'[Timesheet Required] = "Yes"
        ) * _countofPeriod
            - CALCULATE (
                COUNT ( 'Timesheet Hours'[Period Name] ),
                'Employee List'[Timesheet Required] = "Yes",
                FILTER (
                    ALL ( 'Timesheet Hours' ),
                    'Timesheet Hours'[Period Name] IN _selections
                )
            )

     

     

    Best Regards

    Rena