Search

Advertisements

SSRS - In Charts , how to sort labels on X - axis (Horizontal axis)

In this post , I will shown an example on how to sort labels on the X-axis (Horizontal axis)  in SSRS charts .

Below query is going to be my dataset


DECLARE @SalesbyMonth TABLE (Months VARCHAR(20),Sales INT,MonthNo INT)
INSERT @SalesbyMonth SELECT 'January',1000,1
INSERT @SalesbyMonth SELECT 'February',100,2
INSERT @SalesbyMonth SELECT 'March',100,3
INSERT @SalesbyMonth SELECT 'April',200,4
INSERT @SalesbyMonth SELECT 'May',500,5
INSERT @SalesbyMonth SELECT 'June',800,6
INSERT @SalesbyMonth SELECT 'July',500,7
INSERT @SalesbyMonth SELECT 'August',100,8
INSERT @SalesbyMonth SELECT 'September',900,9
INSERT @SalesbyMonth SELECT 'October',600,110
INSERT @SalesbyMonth SELECT 'November',100,11
INSERT @SalesbyMonth SELECT 'December',100,12
SELECT * FROM @SalesbyMonth



Create Column chart with Sales as summation value and Months as Category Groups 





 Try like below (as shown in below images)

 Click on Chart area - > Category Groups - > Category Group Properties ... - >  Sorting - > Sort by 






 Report Preview :














 

2 comments:

Kris Maly said...

I enjoyed reading this article and recommend others.

Practically I carried all the steps mentioned and it worked fine for me.

Thanks for educating the community and appreciate your volunteer-ship

Could you tell me how to convert Full Month name in to 3 letter month in the Expression or any other way.

Thanks a bunch

Kris Maly said...

I enjoyed reading this article and recommend others.

Practically I carried all the steps mentioned and it worked fine for me.

Thanks for educating the community and appreciate your volunteer-ship

Could you tell me how to convert Full Month name in to 3 letter month in the Expression or any other way.

Thanks a bunch

Advertisements