Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
Solved! Go to 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?
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?
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |