Search code examples
reporting-serviceschartsssrs-2008

SSRS bar chart date formatting


I am looking to get weekdays in order, can anyone please help?

At the minute the order is Mon, Weds, Thur, Tue, Fri.

I have removed the A-Z from the sorting.


Solution

  • If you have a field in your dataset that contains the weekdays you can create a calculated field for your dataset and set this expression:

    =Switch(
    Fields!weekday.Value = "Mon", 1,
    Fields!weekday.Value = "Tue", 2,
    Fields!weekday.Value = "Wed", 3,
    Fields!weekday.Value = "Thu", 4,
    Fields!weekday.Value = "Fri", 5,
    Fields!weekday.Value = "Sat", 6,
    Fields!weekday.Value = "Sun", 7
    )
    

    Then you can use the calculated field to sort ascending A-Z or descending Z-A.

    Let me know if this can help you.