Forum Discussion
Anonymous
5 years agoNot applicable
Targets showing as time
Hiya, I am hoping some can point me in the right direction. I am trying to convert into time format based on the total number completed/target In excel I have used sum(Total_completed/tar...
PhilipTreacy
Super User
5 years agoHi Anonymous
Please supply some sample data and what you want the result to look like.
In PBI there is no Time data type, so you can end up storing time/durations as numbers indicating the total number of minutes or hours and then converting those to some human readable format like hh:mm:ss. To do this requires some DAX code like this
HMS =
VAR _time = SELECTEDVALUE('Table'[Minutes])
VAR _hrs = _time / 60 //(Elapsed_Time - days) * 24
VAR hrs = INT(_hrs)
VAR mins = ROUND((_hrs - hrs) * 60, 0)
RETURN
FORMAT(hrs,"00") & ":" & FORMAT(mins,"00") & ":00 "
Which will convert minutes like this
If you can post some data I'll be happy to help.
regards
Phil
Anonymous
5 years agoNot applicable
Hi Philip,
Thanks for coming back to me, apologies for not replying sooner.
The sample data looks like this.
Main Data
Target
Summary
Thanks again for your help.
Claire
- Anonymous5 years agoNot applicable
Hi Philip,
Apologies I also have a measure which is a sum in HH:MM:SS time they had to to the work.
Thanks,
Claire