Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I use R script visual in Power BI desktop. I make a plot with ggplot library and I use encoding UTF-8 (which I use in R in my computer). I used for change script button "Edit script in external R IDE", where the data is loaded specialy with UTF-8 encoding.
# Input load. Please do not change # `dataset` = read.csv('C:/Users/mlasakova/REditorWrapper_331965a2-f26e-41b1-a11e-19984fe5008c/input_df_db204648-f8f7-4ce8-bc69-9a0df5fef2f6.csv', check.names = FALSE, encoding = "UTF-8", blank.lines.skip = FALSE); # Original Script. Please update your script content here and once completed copy below section back to the original editing window #
The final plot in Power BI Desktop looks like this:
But when I publish this script on Power BI services, then the encoding of special characters is wrog (specifically in axis labels) and it looks like this:
Can I change somehow this encoding?
Since 2018 and no solution to this?!
I have found a possible workaround for this issue. Although it is far from optimal.
You can avoid explicitly stating the values of the x-axis and the y-axis by dynamically referencing items in your dataset. That way the encoding is parsed on Power BI level or the browser level, and not the server side R engine level.
For example, change the parameter from this
gg + x_lab("Mesice (format rokmesic)") # you would include your special characters in this (I am using Lithuanian specific characters ą, č, ę, ė and so on..)
to this
col_number <- 1 # the position of the column of interest. It can be 1, 2 or any other, depending on the number of columns in your selected dataset
gg + x_lab(colnames(dataset[col_number]))
If the column name of the first item in your dataset is correct, you should get axes' names that are displayed correctly (incl. the special characters).
Now, this does add a few caveats and complicates the workflow in the script. And in some cases you will need to add additional columns to your dataset just for the naming. But it does solve the utf-8 symbol problem. Be it in a very roundabout way.
I'm having the same issue.
Have you found any solutions or workarounds?
Same problem here.
Maybe with the R Version running on powerBi Server, which is too old (3.4.4).
Is there any plants to update it?
This seems to be an issue of language. You may check Languages for the Power BI service.
Hi @v-chuncz-msft,
Thank you for your answer, but changing language doesn't solve this problem. The encoding in build-in object, for example text boxes or titles of visuals work good without problem. But the R script visual still doesn't work.
Hi @mischelin11
did you solve your problem?
I have the same problem with special characters. When I make a r custom visual, The custom Visual works in Power Bi Desktop however when I publish it in Power Bi Service the special characters doesn't work well.
If you resolved your problem, can you help me with this ?
I have this exact problem, any results? or workaround?
Language encoding problem in Pbi app service
The problem does not exist in Pbi Desktop:
Same problem here.