Forum Discussion

TristanC's avatar
TristanC
New Member
2 years ago

Time Formatting in a Chart

Below you'll see where I've got times imported for a chart, only they're all out of whack. I've tried sorting them in the file itself, in PowerQuery, etc. Tried a bunch of different things and I am absolutely stumped. Anyone know a good way to get these to actually sort by time? Something I did put the 7:00am at the beginning, but not the other AM's - not sure what that was.

 

Many thanks!

 

times are all out of whack

8 Replies

  • TristanC the column you are using on x-axis, you should sort it by a time column which is not a text and then it should work, or you can have time column on the x-axis and change the format of this column the way you want to display and use that on the x-axis.

    • TristanC's avatar
      TristanC
      New Member

      I think I've done what it is you're suggesting. The column itself mis-orders itself, though? In Data View we can see here:

       

       

      That's after I "sort ascending" - so I'm confused as to why it's going from 7:00am to 12:00pm? I've tried sorting by descending, making another column numbering each starting time and sorting from that, nothing seems to work. The Excel file from which I'm working is sorted correctly (by Start Time). It's a puzzler, for sure. Super un-intuitive, however it's supposed to work.

  • TristanC check how this visual is sorted, click on the top right corner, 3 dots and see the sort column and the sort order.

    • TristanC's avatar
      TristanC
      New Member

      Yes, I've got it sorted by x-axis: Start Time (ascending). That's what gives me the weird order of times - 7am straight to 12pm, etc.

  • TristanC weird, this time column is not sorted by any other column, right? And the type of this column is what?

     

    Also, does this column have a date element to it? What value do you see for this column in PQ? I think this column contains date/time value not only time value and that is causing this.

  • TristanC you are sharing the link of the report that is published into your Power BI tenant. Nobody will able to access it without credentials and on top of that you shouldn't be doing that. You are putting your company info in jeopardy. Just a suggestion.

     

    For sharing purposes, create a dummy pbix file and share it using one drive/google drive.