Forum Discussion
Redshift Native SQL is not supporting to pass the multiselect parameters in report builder
- 1 year ago
Hi Koritala ,
As per this document not all data sources support parametersSource: Report parameters in Power BI Report Builder - Power BI | Microsoft Learn
If you still feel the issue is important and not related to source. Please consider reaching out to Microsoft Support. You can provide them with all the troubleshooting steps you've already taken, which will help them understand the issue better and provide a resolution. They might be able to identify something specific about your admin account setup or provide a solution that isn't immediately obvious.
Below is the link to create Microsoft Support ticket:
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
Thank you
Hi Koritala,
I am assuming regionparameter as a text parameter that is a comma-separated string of values ('East','West','North'). regionparameter is a multi-value parameter, and SQL doesn't directly accept it in the IN clause via @parameter syntax.
Can you try with below updated SQL code. Let me know if you have any questions.
select * from sales
where region in (
select trim(value)
from regexp_split_to_table(@regionparameter, ',') as value
)
and sales_date >= @startdateparameter and sales_date <= @enddateparameter
Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.
- Koritala1 year agoPost Patron
Hi Ajay,
Thanks for your response.
I have a question in your provided code What does it mean by "trim(value)". Do you want me to give as similar your code?
Thanks,
Koritala
- ajaybabuinturi1 year agoSuper User
Hi Koritala,
The value is the default column name returned by Redshift’s STRING_TO_TABLE function. STRING_TO_TABLE(@regionparameter, ',') turns a comma-separated string (like 'East,West,North') into a table, where each row contains one region. That temporary table has one column, and it's automatically named value.
- Koritala1 year agoPost Patron
Hi Ajay,
Can you please share the SQL code where I need to pass the product and caegory parameters along with region parameter.
Thanks,
Srinivas.
- ajaybabuinturi1 year agoSuper User
Hi Koritala,
Try with below code
select * from sales where region in (select trim(value) from regexp_split_to_table(@regionparameter, ',') as value) and product in (select trim(value) from regexp_split_to_table(@productparameter, ',') as value) and caegory in (select trim(value) from regexp_split_to_table(@categoryparameter, ',') as value) and sales_date >= @startdateparameter and sales_date <= @enddateparameterThanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.- Koritala1 year agoPost Patron
Hi Ajay, I tried your code, but unfortunately, it did not work. For everyone reference, here I am attaching the screenshots.. please advise anything I missed. I have tried to pass a single selection in my slicer in report bilder as per screenshot.