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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Smcqueen2024
New Member

Query Parameters for Teradata SQL Query in Report Builder

  • I am trying to use query parameters in a query to Teradata. When I use the (@ParameterName) syntax, I get a Teradata error saying the number of parameters called does not match the number of parameters defined. My assumption is that the call for parameters in Teradata is the same as Report Builder, so Teradata is getting confused? I also tried the M Query parameter call "&ParameterName" and it actually called the value. But I got an error saying Teradata expected something between a unicode value and the parameter. Is there a way to escape the parameter call? Or there some other syntax I can use?
3 REPLIES 3
Poojara_D12
Super User
Super User

Hi @Smcqueen2024 

When using query parameters in Teradata within Power BI Report Builder, the standard @ParameterName syntax does not work because Teradata does not support named parameters like SQL Server. Instead, Teradata uses question marks (?) as placeholders for query parameters. However, Power BI Report Builder does not directly bind parameters to ?, so an explicit CAST statement is required. To ensure proper execution, modify the query by replacing @ParameterName with ? and explicitly casting it, such as CAST(? AS VARCHAR(100)). In Report Builder, navigate to the dataset properties and correctly map the ? placeholder to the corresponding parameter. If you encounter errors when using &ParameterName (which is specific to Power Query), avoid that approach. Alternatively, you can handle dynamic filtering by modifying the query to allow for an "All Values" option, using a condition like WHERE ColumnName = ? OR ? IS NULL. By following this approach, Teradata will correctly interpret the parameters, preventing syntax errors and ensuring proper filtering in the report.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
rnola16
Advocate II
Advocate II

Were you able to get past this error ? I use the same Teradata + Report Builder. What is the correct syntax in defining a parameter in the SQL ?

 

Thanks.

Anonymous
Not applicable

Hi @Smcqueen2024 ,

Please check the following unicode values and parameters. Is there a detailed screenshot of the error?

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.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.