Forum Discussion
HOW CAN I GET THE FINAL TIME OF THE CALLS?
- 3 years ago
Ok lets rather do it in Power Query
Add a custom column to total the seconds
Here is the Code :
Time.Hour([Hour]) * 3600
+
Time.Minute([Hour]) * 60
+
[Second]Then
Add another Custom Column to convert it to Timeand here is the code :
#time(0,0,0) + #duration(0,0,0,[Hour converted to seconds])
Finally Change the type of the column to Time
Third Option would be this DAX
Let me know
Hi Anonymous
In Power Query, convert the HOUR column to all Seconds, Add the converted column to the column containing seconds and finaly convert the new column to Time format.
You can do it in DAX as well. The idea is always to render the HOUR column to all seconds...
- Anonymous3 years agoNot applicable
Hi aj1973 , thank you so much for your answer.
I already have the column with all seconds in a integer format. However, I don't know how to convert the column to Time format. I tried it with the function "Convert" but it returns me "dd:mm:yyyy" instead of "hh:nn:ss".
Could you help me? Thank you in advance.
Regards.
- aj19733 years ago
Community Champion
Hey Anonymous
Firts add a column to covert the time to all seconds
Then add a new column to convert all seconds to Time
And here are the 2 DAX codes:
Hour To Sec =( HOUR ( 'Convert'[Hour] ) * 3600 )+ ( MINUTE ( 'Convert'[Hour] ) * 60 ) + 'Convert'[Second]Time =
VAR _Hour =
INT ( MOD ( 'Convert'[Hour To Sec], 86400 ) / 3600 )
VAR _Minute =
DIVIDE (
INT ( MOD ( MOD ( 'Convert'[Hour To Sec], 86400 ), 3600 ) ) - 'Convert'[Second],
60
)
RETURN
_Hour & ":" & _Minute & ":" & 'Convert'[Second]- Anonymous3 years agoNot applicable
Thanks aj1973 ! I could get the column with the Time. Nevertheless, the format is in Text and I need it in Time. When I try to change the format the result is: #ERROR in all rows. Why I can't convert it to a Time format?
Regards,
Bibi
Jara