You can create a text parameter with list of values that are all possible label values (i.e. Male
and Female
):
Make a table that will contain the parameter value. Get data from Blang query
:
and use expression like this:
= #table({"EmployeeGender"},{{#"EmployeeGender"}})
Then get the data from your database, but convert the parameter value (label value) to database value (actual value) using a CASE
expression like this:
case {PARAMETER} when 'Male' then 'M' when 'Female' then 'F' end
Or in M:
= Sql.Database("SERVERNAME", "DATABASENAME", [Query="select * from dbo.SelectEmployees(case '" & EmployeeGender & "' when 'Male' then 'M' when 'Female' then 'F' end)"])
With &
you can concatenate strings, EmployeeGender
is the name of the parameter, which will be replaced with it's value (Male
or Female
) and then SQL Server will execute the case
statement to decode the "label value" to "actual value" (i.e. M
or F
).
Then place the result returned from your query and the contents of your helper table in the report. When changing the parameter's value, you will see only those rows mathing current parameter value and will see the appropriate label: