Forum Discussion

andrewconnell's avatar
andrewconnell
New Member
7 years ago
Solved

Displaying time in line graph

My data source is a collection of elapsed race times over multiple dates. My goal is to display a line graph showing the progress of these elapsed times over the dates they occurred. I understand the Y axis can only have numerical values, so my existing "MM:SS.ms" strings won't work in the graph. I can fix this by converting them to seconds.

 

This fixes the problem & gives me what I want, except for one point: now I'm looking at seconds when my users need to see the time as MM:SS.ms.

 

Ultimately what would be ideal is to tell the line graph "use seconds when plotting everything, but in the display, only use the "MM:SS.ms" in the Y axis and data label while the dates are on the X axis."

 

Does that make sense? Is this possible or are there other ways to achieve the same thing?

  • v-xicai's avatar
    v-xicai
    7 years ago

    Hi,

     

    You can create time column like DAX below, set the Time(seconds) "Sum" ( because it have been set show value as "No calculation" by default, so it won't be aggregated in fact ).

     

    Time = FORMAT(SUBSTITUTE(Table1[Time(minutes)],".",":"),"H:mm:ss")

     

     

     

     

     

     

     

     

     

     

     

    Best Regards,

    Amy

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi andrewconnell ,

     

    As you said, could you please clarify what the red line part is referred to ?

     

     

    I am not sure what desired result would you want, could you please share your sample data or desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

     

    Best Regards,

    Amy

    • andrewconnell's avatar
      andrewconnell
      New Member

      It's not a "red line" I'm looking for... it's showing times over time... referencing the image below, you can see the table of data & the graph that does NOT show what I want... some points:

       

      • The values in the graph currently shown is from the green box, but it wants to sum / count / etc... I want the Y axis to show the actual values, not aggregate them
      • The date on the X axis should be the actual dates... not comparing year over year or month over month
      • Ideally, the values I want to show up in the Y axis and on the data labels are from the purple box (Time (minutes)) but I understand that as a text field, I can't graph it... not sure if there's a way to say "use this property to create the chart, but use the values from this field for the Y axis.

      Does this help?

       

      • v-xicai's avatar
        v-xicai
        Community Support

        Hi,

         

        You can create time column like DAX below, set the Time(seconds) "Sum" ( because it have been set show value as "No calculation" by default, so it won't be aggregated in fact ).

         

        Time = FORMAT(SUBSTITUTE(Table1[Time(minutes)],".",":"),"H:mm:ss")

         

         

         

         

         

         

         

         

         

         

         

        Best Regards,

        Amy

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.