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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Jaceks123123
New Member

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 '.'. ------

 

Zapytanie pod stackoverflow.png


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.

 

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.