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
Serdet
Post Patron
Post Patron

Time Delta

I am creating a time & motion study and want to compare the actual time 'turning spanners' compared to other unproductive tasks.

 

I have created a time log database of all tasks in the working day (similar to below).

TaskStart TimeEnd TimeTime Delta (minutes)
Housekeeping7:308:0030
Time on Tools8:009:50110
Travel9:5010:0010

 

I want to show lost times based on the below logic 

Start work (7:30am) - Break (10:00am)        maximum time on tools = 150min

 

I need a card visual showing the total amount of time on tools in the above period and a table summary of the lost time 

 

Example:

 

Card = 110minutes

Table = House keeping and Travel summary

 

Many thanks,

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Serdet ,

 

According to the information you describe, you can add a judgment condition to the original formula. I did a test, the reference is as follows:

Col_ = 
IF (
    HOUR ( 'Table'[End Time] ) = 10
        && MINUTE ( 'Table'[End Time] ) <= 0,
    TRUE (),
    IF ( HOUR ( 'Table'[End Time] ) < 10, TRUE (), FALSE () )
)

vhenrykmstf_0-1632279602951.png

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @Serdet ,

 

According to the information you describe, you can add a judgment condition to the original formula. I did a test, the reference is as follows:

Col_ = 
IF (
    HOUR ( 'Table'[End Time] ) = 10
        && MINUTE ( 'Table'[End Time] ) <= 0,
    TRUE (),
    IF ( HOUR ( 'Table'[End Time] ) < 10, TRUE (), FALSE () )
)

vhenrykmstf_0-1632279602951.png

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Sounds good. What have you tried and where are you stuck?

Hi,

 

Thanks for your response. I have tried creating a custom column to generate a true of false column using the below DAX

 

7AM-10am = IF(HOUR(dilo_master[end_time]) >= 7 && HOUR(dilo_master[end_time]) <= 10.00 ,TRUE(),FALSE())
 
This works how ever instead of cutting off at 10:00am as required it is pulling end times all the way up to 10:59am. Any ideas how to get around this?
 
Many thanks,
 
Elliot 

Two options. Either remove the equal sign

 

7AM-10am = HOUR(dilo_master[end_time]) >= 7 && HOUR(dilo_master[end_time]) < 10.00

 

or  consider the minutes as well

 

7AM-10am = HOUR(dilo_master[end_time]) >= 7 && HOUR(dilo_master[end_time])*60+MINUTE(dilo_master[end_time]) <= 600.00 

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