Forum Discussion

steambucky's avatar
steambucky
Icon for Helper III rankHelper III
8 years ago
Solved

X-Axis Sort by month AND year

I wanted to data as month and year. I followed these instuctionsin an old post:

 

Solution:

Add a Year Column: FieldYear = YEAR(Date)

Add MonthColumn:  FieldMonth =  MONTH(Date)

THEN ADD SORTORDER column using the two extra columns created above and in this order :  SortOrder =                     CONCATENATE(FieldYear,FieldMonth)

 

(found that solution here : Link)

 

That kind of works with ONE exception (see image )

 

 

You can see where the month has is January ( represented by a 1 ) it is in the wrong month order.

 

The answe ( I think ) is to format the month number as 01 rather than 1.

 

Any idea How do you do this? Or is the more efficent way to do the entire thing?

 

Kind regards,

 

Steam Bucky

 

  • I found the term i was looking for "Leading Zeros - you can add them by using this format funsction: FORMAT(Table[Col],"00")

     

    This would make "1" into "01"

     

     

     

     

     

     

     

     

     

     

     

1 Reply

  • I found the term i was looking for "Leading Zeros - you can add them by using this format funsction: FORMAT(Table[Col],"00")

     

    This would make "1" into "01"