Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Seanan
Solution Supplier
Solution Supplier

Error when passing multiple values to a parameter in report builder

I have a report builder report that uses an Azure SQL database stored procedure for it's dataset.

In this report I have 2 parameter that are single value only and I now want to add a third parameter that allows multiple values to be passed to it.

 

PowerBIReportBuilder_L4IEIjCAne.png

 

I've setup my dataset properties -> parameters to include the new parameter value:

 

PowerBIReportBuilder_dK4jARfsp0.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

However when I enter my values I get the following error:

 

OUsbIRWCQU.png

 

 

 

 

 

PowerBIReportBuilder_zvOc9rGcQI.png

 

 

 

 

 

 

 

 

 

 

 

My stored procedure has a variable at the top:

@CandidateId int

and my where statement has the line:

 

AND CandidateId IN (@CandidateId)

 

 

Any ideas what may be causing this issue and how I can pass multiple values into this parameter?

3 REPLIES 3
josef78
Memorable Member
Memorable Member

Try, do not use "Parameters" page in DataSet configuration (left this empty), and enter parameter name directly into SQL "Query" like this

AND CandidateId IN (@CandidateId)

 

Anonymous
Not applicable

Hi @Seanan ,

According to your error message . It looks like CandidateId is an nvarchar datatype in the table and you've passed an int through your procedure, either use a forced conversion and convert @CandidateId to an nvarchar, or change the CandidateId datatype to an integer in the table.

 

DECLARE @CandidateID_coast NVARCHAR(15)

SET @CandidateID_coast = CAST(@CandidateID AS NVARCHAR)

 

Then use  @CandidateID_coast instead of @CandidateId in SELECT, INSERT and WHERE clause.

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous 

Thanks for your swift response.

 

This is the part that is confusing me because in my source stored procedure the data type for CandidateId is an integer, as shown below:

PowerBIReportBuilder_iDN1JpjoTp.png

 

 

 

I tried what you mentioned but it throws the same error because the where statements looks like this:

WHERE CandidateId IN (@CandidateId_coast)

But CandidateId is a integer and CandidateId_cost is an nvarchar.

 

I feel like the error comes the way multiple values are concatenated and then passed to the parameter, I've tried a few different expressions to break them up and pass them into the (@CandidateId) parameter but I haven't had any success.

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.