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
Anonymous
Not applicable

check duration time

Hi Every One,

 

I want to check if the duration hours  between  ( 3:55 and 4:15 )  return  true otherwise  return  false  using  DAX,  the column that I want to check for  it  in the  below  image 

duration.JPG

 

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

If the 'Duration - Time' column is of data type Time, try this for your new calculated column:

 

NewColumn =
IF (
    Table1[Duration - Time] >= TIME ( 3, 55, 00 )
        && Table1[Duration - Time] <= TIME ( 4, 15, 00 );
    TRUE (),
    FALSE ()
)

You might have to update the conditions depending on whether you want to exclude or include the edge values (3:55 and 4:15)

View solution in original post

3 REPLIES 3
AlB
Super User
Super User

Hi @Anonymous 

If the 'Duration - Time' column is of data type Time, try this for your new calculated column:

 

NewColumn =
IF (
    Table1[Duration - Time] >= TIME ( 3, 55, 00 )
        && Table1[Duration - Time] <= TIME ( 4, 15, 00 );
    TRUE (),
    FALSE ()
)

You might have to update the conditions depending on whether you want to exclude or include the edge values (3:55 and 4:15)

Anonymous
Not applicable

that @AlB 

 

I want to check the  count of  hours only, such as   3 hours and 55 minuts,  if  I uose  your formal  time( 3, 55, 00 )  mean the time  is  3: 55: 00 

@Anonymous 

it should work anyway. You can choose the format as H:mm and it will show as 3:55 without the seconds

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.