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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
DanielB_NL
Helper I
Helper I

Time calculations with 'latest' and 'earliest' values of time-columns in Direct Query mode:

Hi everybody,

 

I've a question about calculation with 'earliest' times:

  • I'm making an overview of the check-in and check-out times of our employees and want to see who starts working too late and/or who stops working too early. Because they check out and in everytime they start working on a new project, often there are multiple records per employee per day.
  • START TIME:

    - The first time they check in on a day is the time they start working: this has to be at latest 8:00h 
    - I've put 'earliest' of time_from_actual in as value, but now I want to check if this value is later than 08:00h: how do I do this?

  • END TIME:
    - The latest time they check out on a day is the time they stop working: this has to be at 17:00h or after 
    - I've put 'latest' of time_to_actual in as value, but now I want to check if this value is before 17:00h: how do I do this?

  • Also an important note: I'm working in DirectQuery mode

Is there anyone who nows how to do this? Thanks in advance for the reply

 

2022-08-05 09_07_26-Window.jpg

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @DanielB_NL ,

 

Please try these measures.

 

Measure = IF(MIN('Table'[time_from_actual]) < TIME(8,0,0), 1, 0)
Measure 2 = IF(MAX('Table'[time_from_actual]) < TIME(17,0,0), 1, 0)

vkkfmsft_0-1659950565487.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-kkf-msft
Community Support
Community Support

Hi @DanielB_NL ,

 

Please try these measures.

 

Measure = IF(MIN('Table'[time_from_actual]) < TIME(8,0,0), 1, 0)
Measure 2 = IF(MAX('Table'[time_from_actual]) < TIME(17,0,0), 1, 0)

vkkfmsft_0-1659950565487.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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