ssrs expression to display first 3 parameter values if "ALL" is selected in Parameter List I have a parameter to display a report, if the parameter is selected as "Select All" then all the values in the parameter list are selected.

But I need the report to display values only for the first 3 parameter values selected.

Is there any filter expression available for this?
I don't think you can influence the behaviour of the "Select All" check box, but you could achieve something similar using  Cascading Parameters.

This is a fairly messy solution, especially if you query for the parameter list is slow, but could be an acceptable solution for your end users.

For example, this could work for you.

First: Create a parameter of boolean type, in my example named "Top3":



Second: Add the same data set twice, in the screenshot below you see 2 datasets, Dataset and Dataset_Filter and 2 parameters, Top3 and Dataparameter

The 2 datasets are essentially the same, based on this query on the adventureworks 2014 database

SELECT  CurrencyCode, Name, ROW_NUMBER() OVER (ORDER BY CurrencyCode ASC) as RowNumber
FROM    Sales.Currency
ORDER BY CurrencyCode ASC


The row number is necessary to be able to select x number of rows by default.

The dataset_filter dataset has an additional filter expression added to it, Please note that it is of type integer

In the value you put whatever "top" number of values you want selected.



The trick lies in the expression, the expression is either the row number or something that will always be smaller than the number of values you want to select. In the expression I use the Top 3 parameter.

=IIF(Parameters!Top3.Value, Fields!RowNumber.Value,1)


So essentially this is saying, either the "rownumber has to be lower than or equal to 3" if  top 3 is true or "1 has to be lower than or equal to 3 if top3 is false"

Then on the DataParameter you say the "Available values" come from dataset:



And on the "Default values" you pic the Dataset_Filter dataset (remember, this will either be the entire dataset or only the first 3 rows)



Once you have that set up you end up with a report that has a parameter to allow you to select "top 3" or "select all" like this:

Top 3 selected:



Top 3 false:



Entire RDL XML can be found here on pastebin but requires adventure works 2014 to be installed on localhost.

If you only want to display the first 3 values the obvious dataset query would be 

SELECT TOP 3 CurrencyCode, Name, ROW_NUMBER() OVER (ORDER BY CurrencyCode ASC) as RowNumber
FROM    Sales.Currency
ORDER BY CurrencyCode ASC