Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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 

 

  • 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)

3 Replies

  • AlB's avatar
    AlB
    Community Champion

    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's avatar
      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 

      • AlB's avatar
        AlB
        Community Champion

        Anonymous 

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