Forum Discussion

Red_prov's avatar
Red_prov
Helper I
3 years ago

Using HH:MM:SS duration in scatter plot visual

Hello!

 

I am working with waitTimes calculated in seconds. I was able to find a measure in order to convert this seconds format to hh:mm:ss.

 

WaitTimeDuration =
VAR hours =
    ROUNDDOWN ( [WaitTimeSeconds] / 3600, 0 )
VAR minutes =
    ROUNDDOWN ( MOD ( [WaitTimeSeconds], 3600 ) / 60, 0 )
VAR seconds =
    INT ( MOD ( [WaitTimeSeconds], 60 ) )
VAR milliseconds =
    round(MOD ( [WaitTimeSeconds], 1 ) * 100,0)
RETURN
    FORMAT(hours,"00") & ":"
        & FORMAT(minutes, "00")
        & ":"
        & FORMAT(seconds, "00")
        & "."
        & FORMAT(milliseconds, "00")
 
 
However i am not able to use this for a Y axis on a scatter plot. I am able to do a minute conversin using ROUNDDOWN which is able to use for my Y axis. 
WaitTimeMinutes = ROUNDDOWN ( MOD ( [WaitTimeSeconds], 3600 ) / 60, 0 )
 
I've read that its a limitation due to duration not being a data type, but was unsure if there was some workaround with another measure option to allow this to be used in my Y axis when i have dateTimes as my X axis.
 
Thanks!

3 Replies

  • Red_prov , one of the axis can be time. But if you want that as measure then it need to in minutes/seconds etc

    • Red_prov's avatar
      Red_prov
      Helper I

      Thanks,

       

      Just for clarification. Using hh:mm:ss / or / mm:ss format in that way is not possible.

       

      If i wanted to use time on the Y axis it would have to be in seconds or convert the seconds to minutes?

       

      Thanks again

    • Red_prov's avatar
      Red_prov
      Helper I

       

      i've found quite a few other posts mentioning you can use DAX to create the format like i mentioned above. but no way to use in visuals due to the lack of data type. So im limited to having the duration format in a table view, but can only use seconds when using it on an Axis in a visual.