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
zukkster
Frequent Visitor

Publishing R visual - ODBC connection string

I have manged to create an R visual in the Desktop that runs a  stored procedure and charts the results. With a lot of trial and error I managed to work out the connection string required in the desktop.

 

con <- odbcDriverConnect( "Driver={SQL Server Native Client 11.0}; Server= ###########; Database=#######; UID=#######; PWD=########")
sql_str <- paste("EXEC contact_density_sent_band ", first_period, ", ", last_period )

strd_prod <- sqlQuery(con, sql_str, rows_at_time=1)

 

If I publish the report, then I get an ODBC connection error. I'm assuming I need to use the Gateway instead of my personal account? Any idea of what the syntax is likely to be to use the Gateway?

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi zukkster,

 

 

Based on your description, you call R ODBC package to access your database in power bi R visual, right? The data you achieved through R ODBC package will not be saved as a dataset in your PBIX file so when you pulish your report there will occur an erro. So I would recommend you to import database data using the built-in power bi ODBC connector and then implement R script in R visual with the dataset in power bi.

 

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi zukkster,

 

 

Based on your description, you call R ODBC package to access your database in power bi R visual, right? The data you achieved through R ODBC package will not be saved as a dataset in your PBIX file so when you pulish your report there will occur an erro. So I would recommend you to import database data using the built-in power bi ODBC connector and then implement R script in R visual with the dataset in power bi.

 

Regards,

Jimmy Tao

The data table has hundreds of millions of records. Is importing this volume of data into Power BI going to be feasable? I've already tried to do this using DAX and while I can make it work, it takes 50 seconds to update the data when you change the date slices - compared to 2 seconds when you use R to send a strored procedure call to the table using ODBC.

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.

Top Solution Authors
Top Kudoed Authors