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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
DanielB_NL
Frequent Visitor

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.