Forum Discussion

moltra's avatar
moltra
Icon for Helper IV rankHelper IV
6 years ago

create report sorted by Date Time, but showing Weekday Text and Time on X axis.

I am looking for a way to create a report for the following data Sorted by Date Time, but the x axis shows Weekday + time.

 

ReadingDate timenameWeekday + time
99206/01/20 01:00 AMwidgetMonday 01:00 AM
108406/01/20 02:00 AMwidgetMonday 02:00 AM
271606/01/20 03:00 AMwidgetMonday 03:00 AM
259606/01/20 04:00 AMwidgetMonday 04:00 AM
104906/02/20 05:00 AMwidgetTuesday 05:00 AM
158606/02/20 06:00 AMwidgetTuesday 06:00 AM
315106/02/20 07:00 AMwidgetTuesday 07:00 AM
316906/02/20 08:00 AMwidgetTuesday 08:00 AM
285706/03/20 09:00 AMwidgetWednesday 09:00 AM
288306/03/20 10:00 AMwidgetWednesday 10:00 AM
153706/03/20 11:00 AMwidgetWednesday 11:00 AM
109306/03/20 12:00 PMwidgetWednesday 12:00 PM
102206/04/20 01:00 PMwidgetThursday 1:00 PM
256006/04/20 02:00 PMwidgetThursday 2:00 PM
291306/04/20 03:00 PMwidgetThursday 3:00 PM
290406/04/20 04:00 PMwidgetThursday 4:00 PM
290506/05/20 05:00 PMwidgetFriday 5:00 PM
101806/05/20 06:00 PMwidgetFriday 6:00 PM
23406/05/20 07:00 PMwidgetFriday 7:00 PM
102206/05/20 08:00 PMwidgetFriday 8:00 PM

 

And show it in a report like this.

 

 

My end goal is to be able to compare the last 2 weeks worth of data by Weekday and time on the same report.

5 Replies

    • moltra's avatar
      moltra
      Icon for Helper IV rankHelper IV

      amitchandak This works, but for some reason when I try and use the weekday name + time column, it shifts the graph to sort the x axis as text.  

       

      Here is how I am getting the weekday name + time column.  I think this is what is causing the problem.  

      weekdaytext = FORMAT('table'[Date],"dddd") & " " & 'table'[Hour]&":00:00"
  • Anonymous's avatar
    Anonymous
    Not applicable

    HI moltra,

    I'd like to suggest you extract these text values and add an index field as sort order, then link to raw table and use new table fields on the original chart to achieve custom sorting.

    Reference blog:

    Custom Sorting in Power BI 
    Regards,

    Xiaoxin Sheng

    • moltra's avatar
      moltra
      Icon for Helper IV rankHelper IV

      When I add the Day of the week column it does not show the date as a sort method.  I think it is cause they are different variable types.  

      It also messes up the goal lines that I got working on another of my questions on here.