Search code examples
sortingreporting-services

SSRS - Sort table based on column value


I am trying to sort the following table:

hYear            hSale
------------------------------------
[year]    =Count(Fields!sale.Value)

The table only has one row group (year) and no column group. I'd like to:

-initially sort the table based on the calculated value; is it possible?

-add interactive sort to calculated column based on the value. I assume I should sort 'Detail rows', but what will be the sort expression?


Solution

  • Yes on both:

    1. Click on the table or grid to make little gray boxes appear. Click in the upper left corner and select properties. Select Sorting. Hit the 'Fx' button. Put in your expression you have above.

    enter image description here

    enter image description here

    1. For dynamic sorting select the cell in a table (not the header) and click 'Text Box Properties. Select 'Interactive Sorting' and select 'Enable interactive sorting on this text box'. Put in your dataset column or else a custom expression like what you did above.

    enter image description here

    enter image description here