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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
axy5093
Helper II
Helper II

Re-ordering the x-axis values

Hi ,

 

I have a table with multiple values for duration, starttime, timestamp etc parsed from a server's log. And I wanted to display a count of projectID and an average of Duration at every hour. SO i extracted day of week and hour from date and time respectively and created a custom column with the following query

Timeline = [WW] & "." & [Day of Week] & "." & [StartHour]. The column is in Text datatype 

 

But when i tried plotting the graph with Timeline as x-axis the order is very different

Capture.PNG

Please notice how the hour is being sorted by only the first digit.

I went on and added a prefix of 0 to hour but that also didnt change the order.

What i wanted it 40.0.0,40.0.1,40.0.2,40.0.3 etc.

Anyhelp is appreciated. 

1 ACCEPTED SOLUTION

Hi, 

 

@TomMartens Thanks for you reply

 

I sorted it by adding a zero to the last digit that is 40.0.00, 40,0.01.

 

 

Regards,

Aish

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey,

 

the order of values on the x-axis can be changed by defining an index column and using this index column to sort the order of values.

 

In the picture below I marked the column "Month Name", then I choose "Sort by Column" from the Modeling menu and  selected the column Month No (the index column)

 

Sort Column by - 02.png

 

By creating the Index column you have to be aware that the value "40.0.0" may occur multiple times in your table, due to the different years. Each occurence must have the same index value.

 

Hopefully this gets you started

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi, 

 

@TomMartens Thanks for you reply

 

I sorted it by adding a zero to the last digit that is 40.0.00, 40,0.01.

 

 

Regards,

Aish

Hi @axy5093,

 

Great to hear the problem got resolved! Could you accept your reply above as solution to close this thread? Smiley Happy

 

Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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