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
mischelin11
Advocate I
Advocate I

Different encoding in Power BI Desktop and Power BI Services (R script visual)

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:

out.PNG

 

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:

 

out1.PNG

 

Can I change somehow this encoding?

9 REPLIES 9
FipaFAN
Frequent Visitor

Since 2018 and no solution to this?!

rokasklydzia
Advocate I
Advocate I

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.

rokasklydzia
Advocate I
Advocate I

I'm having the same issue. 

Have you found any solutions or workarounds?

Anonymous
Not applicable

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?

v-chuncz-msft
Community Support
Community Support

@mischelin11,

 

This seems to be an issue of language. You may check Languages for the Power BI service.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 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

stacyanushka_0-1656165844454.png

 

The problem does not exist in Pbi Desktop:

stacyanushka_1-1656165902033.png

 

 

 

 

 

Same problem here.

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.