So we have data from the client where all of the fields are in English but one field called “Customer Name” is written in the Thai script. And Power BI is not able to detect the letterforms and displays them as “???”. I have tried changing its data category/ data type to custom language in the Power Query and changing it to “Thai” language but the data does not change and still displays the question marks.
It is important for the client to view the data displayed in the Thai script so if anyone has had any experience with doing the same or know of any work-arounds then please do reply.
Thanks a lot!
It seems like the issue might be due to the encoding of the source data. When importing data into Power BI, it’s essential to ensure that the data source encoding is correctly set, especially for non-English characters.
Here’s a step-by-step guide to change the encoding of your data source and fix the issue with Thai characters:
- In Power BI, go to the ‘Home’ tab and click on ‘Edit Queries’ to open Power Query Editor.
- In the Power Query Editor, in the ‘Queries’ pane on the left, click on the query that loads the data with the Thai characters.
- In the ‘Home’ tab in the Power Query Editor, click on ‘Advanced Editor’.
- In the ‘Advanced Editor’ window, locate the line that starts with
Source = ...
(the line that loads your data from the source file or database).
- If your source data is in a CSV or Text file, you’ll need to add an encoding option to the Csv.Document or Text.Document function used in the line. For example, if your current line looks like this:
Source = Csv.Document(File.Contents("path_to_your_file.csv"),[Delimiter=",", Columns=5, Encoding=1252, QuoteStyle=QuoteStyle.None]),
Change the Encoding
value from 1252
to 65001
, which corresponds to the UTF-8 encoding. The updated line should look like this:
Source = Csv.Document(File.Contents("path_to_your_file.csv"),[Delimiter=",", Columns=5, Encoding=65001, QuoteStyle=QuoteStyle.None]),
If your source data is from a database, you’ll need to ensure that your database connection string includes the correct encoding setting (for example, charset=UTF8).
- Click on ‘Done’ to close the Advanced Editor, and then click on ‘Close & Apply’ in the Power Query Editor to apply the changes.
Now, your data should display the Thai characters properly in Power BI. If you still face issues, you might need to explore other encoding options or verify if the source data itself contains the correct Thai characters.
1 Like
Hello @DavieJoe do you have a similar solution for an excel file? And a databricks connection?
To resolve this issue, you can try the following steps:
- Check the encoding used by the Databricks table that contains the Thai script in the “Customer Name” field. Make sure the table is using the correct encoding, such as UTF-8 or UTF-16.
- When connecting Power BI to Databricks, use the Databricks DirectQuery connector, which provides better support for handling different character sets.
To connect Power BI to Databricks using the DirectQuery connector, follow these steps:
- In Power BI, go to Home > Get Data > More.
- In the “Get Data” window, search for “databricks” and select “Azure Databricks (beta)”.
- Click “Connect” and choose “DirectQuery” as the Data Connectivity mode.
- Enter your Databricks cluster details (Server, HTTP Path, Token, and Database) and click “Next”.
- Choose the Databricks table that contains the Thai script in the “Customer Name” field and click “Load”.
Now Power BI should properly display the Thai characters in the “Customer Name” field.
FYI - please, don’t anyone think I’m being a Thai script genius here, I’m testing a Chat GPT bot.
1 Like
Hello @AdityaPuri
Did the responses above help solve your query?
If not, can you let us know where you’re stuck and what additional assistance you need?
If it did, please mark the answer as the SOLUTION by clicking the three dots beside Reply and then tick the check box beside SOLUTION
Thank you
Hi @AdityaPuri
We’ve noticed that no response was received from you on the post above.
Just following up if you still require assistance to solve your inquiry.
In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.
Hi @AdityaPuri
Due to inactivity, a response on this post has been tagged as “Solution”.
If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.