Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ClaireBear
Helper I
Helper I

Time Sheet Tracking - Early, On Time or Late

Hi, 

 

i have a list of multiple customers with employees that all start and end at different times (by company/site). I have calculated a measure to work out the average start time and the average end time, based off clock in time and clock out time.

 

Avg. Start Time =
VAR Result =
AVERAGEX ( VALUES ( 'Date'[Date] ), CALCULATE ( MIN ( 'Employee'[ClockInTime] ) ) )
RETURN
IF ( NOT ( ISBLANK ( Result ) ), Result + TIME ( 0, 0, 0 ) )
 
My question is, how do i apply a calculation to tell me how many employees are early, on time or late based off their Clock In and Clock Out times by company/Site? The Site is a drop down so the table below should update depending on what Site is selected. 
 
Required Result:
ClaireBear_0-1626343121762.png

 

Example Data:

ClaireBear_1-1626344818774.png

 

 

 Thanks

 

3 REPLIES 3
ClaireBear
Helper I
Helper I

ok thanks, i was hoping that the average clock in and clock out time could be used as a benchmark against each employee's clock in time as i dont have this info. 

 

Anonymous
Not applicable

@ClaireBear 

 

Don't despair 🙂 I can see you want something like a dynamic labelling. It's totally doable but you still have to define what you mean by Early, Late... For instance, does Early mean "before the average"? Or "more than 10 minutes before the average"? And is Late "20+ mins after the average"? You have to define this.

Anonymous
Not applicable

Not enough info to solve this. For instance, nobody knows (but you) what the definitions of Early, On Time and Late are.

 

By the way, your formula does too many redundant things. If you exec this in DAX Studio

 

EVALUATE
var Time_ = TIME(20, 2, 1)
return
    {Time_, Time_ + time(0, 0, 0)}

 

you'll notice that the results are exactly the same. Hence, your IF is redundant.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors