Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

In Power BI Report Builder Parameter implicitly converted to int

I have a sql server query which is running fine in management studio.

select
'Request ID' As Label,
'sr.SHIPMENT_REQUEST_ID' As Value
union all
select
'Trial ID' As Label,
CONCAT('''''','cs.CLINICAL_STUDY_ID', '''''') As Value
union all
select
'Site ID' As Label,
'css.SITE_ID' As Value

and return

Label Value
-----------------------------------------
1 Request ID sr.SHIPMENT_REQUEST_ID
2 Trial ID ''cs.CLINICAL_STUDY_ID''
3 Site ID css.SITE_ID

After inserting this query into PBI Report Builder
as a parameter to the query, which is in the form of the picture below
and selecting parameter value as 'Request ID' everything works fine
then when 'Trial ID' is selected it returns an error
----- Incorrect syntax near '.'. ------

 


If I have a query like this

select
'Request ID' As Label,
'sr.SHIPMENT_REQUEST_ID' As Value
union all
select
'Trial ID' As Label,
'cs.CLINICAL_STUDY_ID' As Value
union all
select
'Site ID' As Label,
'css.SITE_ID' As Value

it returns

Label Value
-----------------------------------------
1 Request ID sr.SHIPMENT_REQUEST_ID
2 Trial ID cs.CLINICAL_STUDY_ID
3 Site ID css.SITE_ID

After inserting this query into PBI Report Builder
as a parameter to the query, which is in the form of the picture above
and selecting parameter value as 'Request ID' everything works fine
then when 'Trial ID' is selected it returns an error
----- Conversion failed when converting the varchar value '213960_UAT'
to data type int. ------

In addition, I noticed that the data in the database for the 'Shipment Request ID' column are only integers
and in the 'Trial ID' column there are both numbers and letters.

 

No Replies