Skip to Content
0
Former Member
Dec 11, 2014 at 09:18 AM

Sort months according to calender

21 Views

Hi Developers,

I have a requirement to sort months according to calender.

For ex: I want to create a line graph with the details shown in below table.

Month Name Employees Present November 50

January

47 March 23 September 54

Result should be

Month Name Employees Present January 47

March

23 September 54 November 50

We can use custom sort, but it will not be optimum if we have year # along with month.

I tried to create a measure variable say MonthNumber having the formula

= if([MonthName]="January") then 1

elseif([MonthName]="March") then 3

else if ....similarly for other entries.

Drop this measure into the table and sort in ascending order. In turn, the months column is sorted according to 2nd table shown. Then hide the MonthNumber column and convert the table to a line chart.

Do you know any other ways of achieving this? Pls let me know.

Thanks,

Shreyas