Reply
Frequent Visitor
Posts: 7
Registered: ‎02-07-2017
Accepted Solution

Sort month names by their number in X axis of line chart

I have a line chart visual that displaying monthly temperature.

The temperature values are stored in a table with a column [M] which is the integer month number, from 1 to 12.

When I plot them I got something like this

2017-03-20_9-17-59.png

As you see, I have the numbers in X-Axis, however, I want to display Month Names instead, e.g. {Jan, Feb, ... , Dec}

I have created a table with two columns, one for months numbers, and the other for names, as suggested by this post, and I followed what they suggested by sorting by column, (I made a relationship between [M] and the month number) but unfortunately it fails, as this what I got!

2017-03-20_9-36-08.png

As you see, the chart sorts the months on unknown criteria, neither by month numbers, nor by month names alphabetically, but they are almost in descending order by value of temperature!

 

Please help my drawing this graph sorting x-axis labels by month numbers instead of this.

 

Thanks in advance.


Accepted Solutions
Highlighted
Super Contributor
Posts: 1,509
Registered: ‎11-29-2015

Re: Sort month names by their number in X axis of line chart

Hi @DrNesr,

 

The default sort order for text based fields is alphabetic.  So normally you need a numeric column alongside this that you can use the "Sort by column" feature.

 

In your case it seems something different.  It looks like it's almost sorting highest to lowest.

 

In the top right hand corner of your visual there is the ... elipsis.  In there you can set a sort order.  Can you please check to see what that is currently set to?

 

sort by.png

View solution in original post


All Replies
Highlighted
Super Contributor
Posts: 1,509
Registered: ‎11-29-2015

Re: Sort month names by their number in X axis of line chart

Hi @DrNesr,

 

The default sort order for text based fields is alphabetic.  So normally you need a numeric column alongside this that you can use the "Sort by column" feature.

 

In your case it seems something different.  It looks like it's almost sorting highest to lowest.

 

In the top right hand corner of your visual there is the ... elipsis.  In there you can set a sort order.  Can you please check to see what that is currently set to?

 

sort by.png

Frequent Visitor
Posts: 7
Registered: ‎02-07-2017

Re: Sort month names by their number in X axis of line chart

You are awesome @Phil_Seamark,

Thank you very much for this solution.

I checked the dots you mentioned, I found the following 

 

2017-03-20_10-11-50.png

 

Then I clicked the first item (Sort by M_Name

 

I got the following

 

2017-03-20_10-14-34.png

But it was sorted from December to Jauary, I clicked again on the Z-A icon next to the ffirst item as shown

 

Finally it is solved.

 

2017-03-20_10-12-22.png

 

Thanks a lot.

Super Contributor
Posts: 1,509
Registered: ‎11-29-2015

Re: Sort month names by their number in X axis of line chart

Cool, looks fantastic!