Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Creating A Missing Timesheets Table

I have some timesheet data for my company and I am trying to create a visual that will report wheather a specific employee has missing timesheets. 

 

The primary data table looks something like this... 

 

Name    Date                   LineTask        Hours

A            10/01/2022       Meetings      8
B            10/01/2022       Meetings      8
A            10/02/2022       Meetings      8
C            10/01/2022       Meetings      8
A            10/03/2022       Meetings      8
C            10/02/2022       Meetings      8

 

The above table is very simplified, we have hundreds of employees with varous types of line tasks they can choose from, but the above table is a consice enough example.

 

Now for this example say if our reporting period was between 10/01/2022 - 10/03/2022.
We can deduce that employee A has submitted time for all 3 days. Employee B has days 10/02 & 10/03 missing and employee C
is missing 10/03. 

 

I also have a tables with all employee names that looks like:

 

name totalhours

A        24
B         8
C         16

 

This above table was easy to calculte using dax. 

 

My goal is to report this in some sort of manner but I am having difficulties calculting those missing days in Power Bi.

First I though i should make a calendar table in dax and have each employee as a column something that looks like this:
Date                     A             B          C
10/01/2022         True        True      True
10/02/2022          True      False      True 
10/03/2022         True      False        False

The trues represent that the timesheet entry is present, and false represents that they are missing.
I can create a table with the dates in both dax and power query editor, but I have no idea how to make each employee as a column and do the caluclation if the sheet is missing or not.

 

Maybe Im approaching this problem in a wrong way altogether? Im thinking like an excel user trying to make the above table, but I donot know how I could use measures to do what i want to achieve. Thank you

  • Anonymous - you can do as:

    myMeasure = 
    IF(
        LOOKUPVALUE(
            TableName[Date],
            'Date'[Date],SELECTEDVALUE(TableName[Date])
        ),
        TRUE()
    )

2 Replies

  • ChrisMendoza's avatar
    ChrisMendoza
    Resident Rockstar

    Anonymous - you can do as:

    myMeasure = 
    IF(
        LOOKUPVALUE(
            TableName[Date],
            'Date'[Date],SELECTEDVALUE(TableName[Date])
        ),
        TRUE()
    )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Chris so I used your soultion and it works great, however I wanted to refine this further. In order for the data to be useful I wanted to group the days by week. However for each week, the measure evalutes to false even if all days were true. See the below picture please

    Thank You for the help.