Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
rliu
Helper I
Helper I

Rank text on X axis: Duration type

Hi everyone,

 

I am trying to plot a time series over 24 hours in a day. My x-axis data looks like this:

9.PNG0-1 stands for the counts in 00:00-01:00 and 23-24 stands for 23:00-24:00. 

To make sure that the x axis is in the time order insteand of text order, I currently have two ideas:

1. create a new column to and manually input corresponding rank and sort my "time range" by that new column. But this means repeated work which I tend to avoid.

2. change the data type of "time range" to some supported time-related data type like "Duration". How to achieve this though?

 

Thank you for all your help!

5 REPLIES 5
rliu
Helper I
Helper I

I solved the problem by replacing 1-2 with 01-02 and 3-4 with 03-04 etc. 

Still would like to know how to do it by taking advantage of the supported data type. So welcome to share!

Greg_Deckler
Community Champion
Community Champion

Why would the first option need repeated work? If you have a related table with time_range and time_range_sort, then that table should be absolutely static within your data model.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

 Hi @Greg_Deckler,

So

1. when creating the time range order, don't I have to manually input 1-24 correspondingly?

2. the idea of using releted table sounds good. But I don't know how to do that. Can you elaborate it?

 

Thanks

Could we consider to omit the “-” here?

 

Or consider replace the “- ” with a special number like “0” ?

 

There is no available data types that would make the time range here (with the “-” inside numbers) to format as number type.

Also as you already suggested, create another column to give a manually rank seems to be a more suitable way.

 

Regards,

Charlie Liao

 

Yes, you would have to enter it one time manually. Easiest way to do this is to use Enter Data and just put in your time_range column and your time_range_sort column manually. Close that and set your "Sort By". Then use the Relationships pane (3rd icon down on the left-hand side in Desktop) and drag time_range column from one table to your new "lookup" table. Then, use the time_range column from your new "lookup" table in your visuals.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors