Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ELIU
Helper I
Helper I

Translate underlying data in data model dynamically to a different language

Hi,

 

I have done some research and still couldn't figure out what would be the best way to dynamically translate the actual underlying data to a different language than English. For example, I have 10K rows and +20 columns in a table and need to translate every row into a different language today. Next day there are 100 new rows coming in to the PBIX file after the data source is refreshed. The 100 new rows of data also needs to be translated automatically. 

 

Any hints? Appreciate it!

1 ACCEPTED SOLUTION

Hi @ELIU ,

Thank you for reaching out to the Microsoft Community Forum.

 

1. Using a Translation API (Microsoft Translator)

Step-by-Step Workflow:

Step 1: Prepare Your Azure Translator API. Create an Azure account if you don't have one. Set up a Translator resource under Azure Cognitive Services. Obtain the API key and endpoint URL.

Step 2: Use Power Query in Power BI to Call the API. In Power BI Desktop, go to Transform Data ->open Power Query Editor.

Add a new column (or modify an existing one) that makes a web request to the Translator API using M code.

Sample M Code:

let
sourceText = [YourColumnToTranslate],
apiKey = "YOUR_API_KEY_HERE",
endpoint = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=fr",
body = "[{""Text"":""" & sourceText & """}]",
response = Json.Document(Web.Contents(endpoint,
[
Headers = [
#"Ocp-Apim-Subscription-Key" = apiKey,
#"Content-Type" = "application/json"
],
Content = Text.ToBinary(body)
])),
translatedText = response{0}[translations]{0}[text]
in
translatedText


Step 3: Refresh Logic

Every time the dataset is refreshed, Power Query will send new (or changed) rows to the API for translation. You can use conditional logic to avoid re-translating already translated rows.

2. Use Power Query and Custom Connector Together

A custom connector is a piece of M code that encapsulates external API access logic. You use this to simplify or securely manage API calls from Power Query.

Why Use a Custom Connector?
Better security (store secrets like API keys safely). Reusability across reports. Cleaner Power Query code (use connector as a function). Support for OAuth2 or API key authorization flows.

Please follow below steps for Custom Connector

Step 1: Create a custom connector using M and the Power Query SDK for Visual Studio.
Step 2: Code your connector to accept a text input and return the translated result using the Translator API.
Step 3: Deploy the connector and use it in Power BI as a data source.

Example: M Function You Could Wrap in a Connector

(sourceText as text, targetLang as text) as text =>
let
body = "[{""Text"":""" & sourceText & """}]",
response = Json.Document(Web.Contents("https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=" & targetLang,
[
Headers = [
#"Ocp-Apim-Subscription-Key" = "your_key",
#"Content-Type" = "application/json"
],
Content = Text.ToBinary(body)
])),
translated = response{0}[translations]{0}[text]
in
translated

 

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

View solution in original post

4 REPLIES 4
v-dineshya
Community Support
Community Support

Hi @ELIU ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please try below options.

1. Use a Translation API (Microsoft Translator, Google Cloud Translation)

These services can translate large volumes of data and are highly scalable.

2. Pre-process Data Before Loading into Power BI

Instead of translating data inside Power BI, you handle translation before it gets into the PBIX file.

Options:

1.Use Power Query and Custom Connector together.

2.Azure Data Factory / Synapse Pipelines with REST calls to translation API

3.Python or PowerShell Script to process data + translate + save to staging area

Incremental Translation: You need to avoid re-translating, Keep a separate translation table with original text, translation, and language.

Note: When new data comes in: Check against the translation table. Only send new/untranslated rows for translation. Append them to your translated data store

 

Please refer community threads and Microsoft articles.

Solved: column dynamic language translation - Microsoft Fabric Community

Solved: Text Translate options - Microsoft Fabric Community

Solved: How to Create a Dynamic Multi-Language Dashboard i... - Microsoft Fabric Community

Plan translation for multiple-language reports in Power BI - Power BI | Microsoft Learn

Implement data translation using field parameters - Power BI | Microsoft Learn

Extend the data source schema to support data translations - Power BI | Microsoft Learn

Generate machine translations using Azure Translator Service - Power BI | Microsoft Learn

Building Multi-language Reports for Power BI in 2023 | Microsoft Power BI Blog | Microsoft Power BI

Add a Localized Labels table to a Power BI report - Power BI | Microsoft Learn

Use locale values in multiple-language Power BI reports - Power BI | Microsoft Learn

Add a language to a Power BI report in Translations Builder - Power BI | Microsoft Learn

Implement a data translation strategy - Power BI | Microsoft Learn

Create multiple-language reports with Translations Builder - Power BI | Microsoft Learn

Implement data translation using field parameters - Power BI | Microsoft Learn

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Thank you @v-dineshya for your reply and help. Can I ask a couple of follow up questions? 1, If I choose the Use a Translation API (Microsoft Translator) method, what would be the work flow? 2, Could you elaborate more on this: Use Power Query and Custom Connector together? Thanks

Hi @ELIU ,

Thank you for reaching out to the Microsoft Community Forum.

 

1. Using a Translation API (Microsoft Translator)

Step-by-Step Workflow:

Step 1: Prepare Your Azure Translator API. Create an Azure account if you don't have one. Set up a Translator resource under Azure Cognitive Services. Obtain the API key and endpoint URL.

Step 2: Use Power Query in Power BI to Call the API. In Power BI Desktop, go to Transform Data ->open Power Query Editor.

Add a new column (or modify an existing one) that makes a web request to the Translator API using M code.

Sample M Code:

let
sourceText = [YourColumnToTranslate],
apiKey = "YOUR_API_KEY_HERE",
endpoint = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=fr",
body = "[{""Text"":""" & sourceText & """}]",
response = Json.Document(Web.Contents(endpoint,
[
Headers = [
#"Ocp-Apim-Subscription-Key" = apiKey,
#"Content-Type" = "application/json"
],
Content = Text.ToBinary(body)
])),
translatedText = response{0}[translations]{0}[text]
in
translatedText


Step 3: Refresh Logic

Every time the dataset is refreshed, Power Query will send new (or changed) rows to the API for translation. You can use conditional logic to avoid re-translating already translated rows.

2. Use Power Query and Custom Connector Together

A custom connector is a piece of M code that encapsulates external API access logic. You use this to simplify or securely manage API calls from Power Query.

Why Use a Custom Connector?
Better security (store secrets like API keys safely). Reusability across reports. Cleaner Power Query code (use connector as a function). Support for OAuth2 or API key authorization flows.

Please follow below steps for Custom Connector

Step 1: Create a custom connector using M and the Power Query SDK for Visual Studio.
Step 2: Code your connector to accept a text input and return the translated result using the Translator API.
Step 3: Deploy the connector and use it in Power BI as a data source.

Example: M Function You Could Wrap in a Connector

(sourceText as text, targetLang as text) as text =>
let
body = "[{""Text"":""" & sourceText & """}]",
response = Json.Document(Web.Contents("https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=" & targetLang,
[
Headers = [
#"Ocp-Apim-Subscription-Key" = "your_key",
#"Content-Type" = "application/json"
],
Content = Text.ToBinary(body)
])),
translated = response{0}[translations]{0}[text]
in
translated

 

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Hi @ELIU ,

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.