Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
which I want to translate from Thai to English, now I have a problem that it is translated to %E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%97%E0%B8%A3%E0%B8%B2%E0%B8%9A%E0%B8%AA%E instead of English which is every row But if in any area the text is translated into English, it will be correct.
My M soruce:
let
Source = Json.Document(Web.Contents("http://192.168.99.46:8097/api/Mrr")),
#"Converted to Table" = Table.FromList(
Source,
Splitter.SplitByNothing(),
null,
null,
ExtraValues.Error
),
#"Expanded Column1" = Table.ExpandRecordColumn(
#"Converted to Table",
"Column1",
{
"mrr_num",
"item",
"create_date",
"qty_mrr",
"raisedByID",
"raisedByName",
"failure",
"problemdescription",
"cause",
"causeOfDefact",
"ref_type",
"ref_num",
"ref_line",
"ref_release",
"entity",
"dispositionSerialNumber",
"dispositionFeature",
"dispositionFaultCode",
"dispositionCauseCode",
"dispositionQuantity",
"disposition",
"dispositionNote",
"lot_num",
"uf_ApprovalStatus",
"recordDate",
"unitcost",
"wiptotal",
"productName",
"suffix",
"status",
"closeDate",
"dispositionDate"
},
{
"mrr_num",
"item",
"create_date",
"qty_mrr",
"raisedByID",
"raisedByName",
"failure",
"problemdescription",
"cause",
"causeOfDefact",
"ref_type",
"ref_num",
"ref_line",
"ref_release",
"entity",
"dispositionSerialNumber",
"dispositionFeature",
"dispositionFaultCode",
"dispositionCauseCode",
"dispositionQuantity",
"disposition",
"dispositionNote",
"lot_num",
"uf_ApprovalStatus",
"recordDate",
"unitcost",
"wiptotal",
"productName",
"suffix",
"status",
"closeDate",
"dispositionDate"
}
),
#"Changed Type" = Table.TransformColumnTypes(
#"Expanded Column1",
{
{"mrr_num", type text},
{"item", type text},
{"create_date", type datetime},
{"qty_mrr", Int64.Type},
{"raisedByID", Int64.Type},
{"raisedByName", type text},
{"failure", type text},
{"problemdescription", type text},
{"cause", type text},
{"causeOfDefact", type text},
{"ref_type", type text},
{"ref_num", type text},
{"ref_line", Int64.Type},
{"ref_release", Int64.Type},
{"entity", Int64.Type},
{"dispositionSerialNumber", Int64.Type},
{"dispositionFeature", type text},
{"dispositionFaultCode", type text},
{"dispositionCauseCode", type text},
{"dispositionQuantity", Int64.Type},
{"disposition", type text},
{"dispositionNote", type any},
{"lot_num", type text},
{"uf_ApprovalStatus", type text},
{"recordDate", type datetime},
{"unitcost", type number},
{"wiptotal", type number},
{"productName", type text},
{"suffix", Int64.Type},
{"status", type text},
{"closeDate", type datetime},
{"dispositionDate", type datetime}
}
),
#"Added translated column" = Table.AddColumn(
#"Changed Type",
"cause_of_defect(eng)",
each
if [causeOfDefact] <> "" then
let
encodedDescription = Text.Replace(Uri.EscapeDataString([causeOfDefact]), "%20"," "),
apiEndpoint = "https://translate.googleapis.com/",
relativepath = "translate_a/single",
jsonResponse = try
Json.Document(
Text.FromBinary(
Web.Contents(
apiEndpoint,
[
RelativePath = relativepath,
Query = [
client = "gtx",
sl = "th",
tl = "en",
dt = "t",
q = encodedDescription
]
]
)
)
)
otherwise
null,
translatedText =
if jsonResponse
<> null and List.NonNullCount(jsonResponse)
> 0 and List.NonNullCount(List.First(jsonResponse))
> 0
then
try Text.From(List.First(List.First(jsonResponse)){0}) otherwise null
else
null
in
if translatedText <> null then translatedText else ""
else
""
),
#"Renamed Columns" = Table.RenameColumns(
#"Added translated column",
{{"create_date", "Date_Create"}}
)
in
#"Renamed Columns"
Solved! Go to Solution.
@Tiger2514555 , Please check URI functions can help
https://learn.microsoft.com/en-us/powerquery-m/uri-functions
@Tiger2514555 , Please check URI functions can help
https://learn.microsoft.com/en-us/powerquery-m/uri-functions
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
57 | |
55 | |
55 | |
37 | |
30 |
User | Count |
---|---|
78 | |
66 | |
45 | |
44 | |
40 |