Forum Discussion

AsyrafDzul's avatar
AsyrafDzul
Regular Visitor
3 months ago
Solved

Time vs Time Scatter Chart

Hi All, I've been trying to recreate a scatter chart i made in excel in the powerBI. I've read it somewhere that the x & y-axis needs to be a decimal value in order to create a scatter chart. ...
  • stoic-harsh's avatar
    3 months ago

    Hey AsyrafDzul,

    Here is a neat trick! Since scatter plots require numeric axes, we convert time values into HH.MM decimal format - readable as time (dimension), plottable as a number (measure). Example:

    // Calculated Column
    OfficeBadgeIn_HHMM = 
    VAR Hours   = HOUR('TEST'[OfficeBadgeIn])
    VAR Minutes = MINUTE('TEST'[OfficeBadgeIn])
    RETURN
        Hours + ( Minutes / 100 )

    The HH.MM format is numeric enough for Power BI to plot, and intuitive enough to read as time (use appropriate call-outs for business users).

    Hope it helps! Please do share if you find other workarounds.

    Best,

    Harshit

  • v-echaithra's avatar
    3 months ago

    Hi AsyrafDzul ,

    Thank you stoic-harsh  for your valuable innputs.
    Try this:

    Click dropdown on X Axis field

    Set aggregation = Average or Sum

    Same for Y Axis

    Do NOT choose "Don't summarize"

     

    If you still see grouped points after adding Staff Name to Values, create a unique row ID:

     

    RowID = 'Table'[Staff Name] & "-" & FORMAT('Table'[Date],"yyyymmdd")

     

    Then use RowID in Values instead of Staff Name.

    Also keep your time decimal columns as Calculated Columns, not Measures. That will give you one dot per row/record instead of aggregated totals.

    Hope this helps.