Forum Discussion
Anonymous
4 years agoNot applicable
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: ...
- 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 providedDEFINE 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] )
Jihwan_Kim
4 years agoSuper User
Hi,
Please check the below measure and the attached pbix file.
Result measure: =
VAR _hourbegin =
LEFT ( SELECTEDVALUE ( Data[pick begin] ), 2 )
VAR _minbegin =
RIGHT ( SELECTEDVALUE ( Data[pick begin] ), 2 )
VAR _hourend =
LEFT ( SELECTEDVALUE ( Data[pick end] ), 2 )
VAR _minend =
RIGHT ( SELECTEDVALUE ( Data[pick end] ), 2 )
VAR _timebegin = _hourbegin * 60 + _minbegin
VAR _timeend = _hourend * 60 + _minend
RETURN
_timeend - _timebegin