Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Time Format Boolean Column

Hi,    I have created a calculated column to show if certain end time (format 09:20) is false between certain ranges.   DAX used 7AM-10am = IF(HOUR(dilo_master[end_time]) >= 7 && HOUR(dilo_mast...
  • mahoneypat's avatar
    mahoneypat
    4 years ago

    I assumed your end time column was a Time column, but is it a DateTime?  If so, you'll have to get the time component from it like this.  You should consider splitting DateTime columns if not already.

     

    7AM-10am =
    VAR vTime =
        TIME ( HOUR ( dilo_master[end_time] )MINUTE ( dilo_master[end_time] )SECOND ( dilo_master[end_time] ) )
    RETURN
        IF (
            vTime >= TIME ( 700 )
                && vTime <= TIME ( 1000 ),
            TRUE (),
            FALSE ()
        )

    Pat