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
DaveRuijter
Advocate II
Advocate II

R script fails to load more than 14999 rows

 

Power BI Desktop fails to load more than 14999 rows using an R script.

 

This is the script I'm using:

library(RODBC)
mycon<-odbcDriverConnect('driver={SQL Server};server=<servername>;database=<databasename>;trusted_connection=true')
queryResult <-sqlQuery(mycon, "SELECT TOP 15000 <columns> FROM <view>")
View(queryResult)

The script executes fine in Rstudio.

When I change the TOP 15000 into TOP 14999 the script works fine in Power BI Desktop.

Any ideas what this could be?

 

This is the error message:

DataFormat.Error: Unable to translate bytes [E9] at index 6 from specified code page to Unicode.

1 ACCEPTED SOLUTION

Thanks. I've managed to isolate the problem to a é character in an emailadres..

If I alter the view to replace that character it works for that row, but other rows give errors.

So I've added CONVERT(varchar,Emailadres) COLLATE Cyrillic_General_CI_AI and now it seems to work.

 

The big question remains: why does the query fail in Power BI Desktop while it runs fine in Rstudio?

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

The same script works on 15,000 rows (and more) for me. Can you track down what's in the 15000th row it's possible there's something odd in it (e.g. character data in what otherwise looks to be numeric data).

Thanks. I've managed to isolate the problem to a é character in an emailadres..

If I alter the view to replace that character it works for that row, but other rows give errors.

So I've added CONVERT(varchar,Emailadres) COLLATE Cyrillic_General_CI_AI and now it seems to work.

 

The big question remains: why does the query fail in Power BI Desktop while it runs fine in Rstudio?

This would be a great item to submit as a bug report, especially since you have isolated the problem and have a resokution.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.