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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
DanielB_NL
Helper I
Helper I

Show only 1 record per employer, per day with earliest time

Hi all! I'm rather new to Power Bi, I have a question and can't find a topic similar enough to my question, so here it is:

  • I have a large table from a time registration. Each day an employee checks in and out multiple times
  • I want to see per employ, per day. what the earliest 'time_from_actual' is
  • My datasource is a MS SQL database to which I connect via DirectQuery, so I'm limited in my DAX-statements, I think...

Does someone know the answer? Thanks in advance,

 

Screenshot_employee.png

1 ACCEPTED SOLUTION
timg
Solution Sage
Solution Sage

Hi Daniel,

If you are visualizing the data within a context that includes the date and employee (e.g. the table below), you could also implicitly set the time_from_actual column to "earliest" by clicking the arrow next to the time_from_actual column in the columns well.

2.PNG

 

Regards,

 

Tim





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
timg
Solution Sage
Solution Sage

Hi Daniel,

If you are visualizing the data within a context that includes the date and employee (e.g. the table below), you could also implicitly set the time_from_actual column to "earliest" by clicking the arrow next to the time_from_actual column in the columns well.

2.PNG

 

Regards,

 

Tim





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@timg Hi Tim, you solution worked fine. I have an overview of the starting time per employee per day.

 

I want to see if people are starting too late, this means after 08:000h. so in in addition to my earlier question: is it also possible to create a filter so that I only show the rows (with the 'earliest' value per day) that are after 08:00h?  The standard filter aren't of any use, because they ask me to specify a date-time combination? 

rohit_singh
Solution Sage
Solution Sage

Hi @DanielB_NL ,

Please try the following :

1) Create a calculated column named "earliest_time_from_actual" on your table which calculates the earliest time for each employee per day.

 

rohit_singh_0-1653483959964.png

 

earliest_time_from_actual =

CALCULATE(
MIN(EmployeeClock[time_from_actual]),
FILTER(
ALLEXCEPT(EmployeeClock, EmployeeClock[employee_code]),
NOT(ISBLANK(EmployeeClock[time_from_actual])) &&
EmployeeClock[project_hour_date] = EARLIER(EmployeeClock[project_hour_date]) &&
EmployeeClock[time_from_actual] < EARLIER(EmployeeClock[time_from_actual])
)
)
 
 
2) Create a new table "employee_clock_summarized" that summarizes employee_code, project_hour_date and earliest_time_from_actual
 
rohit_singh_1-1653484211245.png

 

employee_clock_summarized =

SUMMARIZE(
FILTER(EmployeeClock, not(isblank(EmployeeClock[earliest_time_from_actual]))),
EmployeeClock[employee_code],
EmployeeClock[project_hour_date],
EmployeeClock[earliest_time_from_actual]
)

 

This should give youthe intended result.

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.