Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create Hour from Text

Hi, what I am trying to do is to create a new column (measure) that will calculate the differences between pick begin AND pick end. The result should be in minutes.   The format is like below:   ...
  • tamerj1's avatar
    tamerj1
    4 years ago

    Anonymous 
    This is not my measure. You can also try by defining a new column as per the calculated column code that I've provided

    DEFINE
    COLUMN 'Pick Order'[Column Result] =
    VAR PickBegin =
        VALUE ( RIGHT ( 'Pick Order'[PICK Time pick begin], 2 ) ) + 60 * VALUE ( LEFT ( 'Pick Order'[PICK Time pick begin], 2 ) )
    VAR PickEnd =
        VALUE ( RIGHT ( 'Pick Order'[PICK Time pick end], 2 ) ) + 60 * VALUE ( LEFT ( 'Pick Order'[PICK Time pick end], 2 ) )
    RETURN
        PickEnd - PickBegin
    
    EVALUATE
    SUMMARIZECOLUMNS (
        'Pick Order'[PICK Time pick begin],
        'Pick Order'[PICK Time pick end],
        'Pick Order'[Column Result]
    )