Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How do I get the time to sort by order rather than by the value?

I would like for the time to start from midnight to the last hour I have (8:00pm/20:00). How do I get it to sort that way?

2 Replies

  • Add a calculated column that shows the number of minutes passed in a day until your interval time. Then sort your interval column by that new column. If you get a circular reference error you can add the new column in Power Query instead.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    You can take a look at the following to add a custom 'sort order' table to specify the order of your table records. 

    Custom Sorting in Power BI 

    You can add a custom column to extract the hour value and create a custom table from 0 to 23 and set the sort order with offset 8 as index and link to raw table 'hour' column.

    Regards,
    Xiaoxin Sheng