Integration of Azure Cognitive Services - Text Translation in Power BI Reports

Harsh Vardhan Shalihotri 0 Reputation points
2023-07-21T08:25:39.5166667+00:00

Hi,

I have been recently using Microsoft Azure Cognitive Services and there is a feature of text translation where any language (English) can be detected and converted into another (Spanish).

I want to implement this in Power BI reports.

Let's say I have build a dashboard (English) and wanted to convert the whole in any other language. How to make this happen?

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,663 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Tech-Hyd-1989 5,816 Reputation points
    2023-07-21T08:31:01.0666667+00:00

    Hello Harsh Vardhan Shalihotri

    Sure, here are the steps on how to implement Azure Cognitive Services text translation in Power BI reports:

    1. Create a Power BI report in English.
    2. Create a new query in the report and select the Azure Cognitive Services folder.
    3. Select the Text Translation function.
    4. In the Text Translation dialog, enter the following information:
    • Language - The language of the text that you want to translate.
    • Target Language - The language that you want to translate the text to.
    • Text - The text that you want to translate.
    1. Click OK.
    2. The translated text will be returned in the query results.
    3. You can now use the translated text in your Power BI report.

    Here are some additional tips for implementing Azure Cognitive Services text translation in Power BI reports:

    • You can use the Language Detection function to detect the language of the text before you translate it.
    • You can use the Key Phrase Extraction function to extract key phrases from the text before you translate it.
    • You can use the Sentiment Analysis function to analyze the sentiment of the text before you translate it.

    Link: https://learn.microsoft.com/en-us/power-bi/connect-data/service-tutorial-use-cognitive-services

    https://learn.microsoft.com/en-us/azure/ai-services/translator/text-translation-overview

    I hope this helps! Let me know if you have any other questions.

    0 comments No comments

  2. Azar 29,520 Reputation points MVP Volunteer Moderator
    2023-07-21T08:32:49.9266667+00:00

    Hi @Harsh Vardhan Shalihotri you can follow these general steps to generate the report

    1. Set up Azure Cognitive Services:
      • Go to the Azure portal (https://portal.azure.com) and create an Azure account if you don't have one.
        • Create a new Cognitive Services resource. Select "Text Analytics" as the service type.
          • Note down the API key and endpoint URL of the Cognitive Services resource. You'll need these to access the translation service.
    2. Prepare your Power BI report for translation:
      • Design your Power BI report in English and ensure that all the textual elements (visuals, tables, titles, etc.) are in English.
        • If you have used any hardcoded text in your report, consider replacing it with Power BI measures or calculated columns based on DAX expressions.
    3. Access the Azure Cognitive Services Translation API in Power BI:
      • Open your Power BI report, go to the "Home" tab, and click on "Transform data" to open Power Query Editor.
    4. Create a new custom function for translation:
      • In the Power Query Editor, click on "Home" and then "Advanced Editor."
        • Write a custom function using M-language that calls the Azure Cognitive Services Translation API using the API key and endpoint URL. The function should take an English text as input and return the translated text in the desired language
          • Once you have created the custom function, you can use it to translate the text in your report elements.
            • Create a new column or measure in Power Query Editor that calls the custom function with the English text as input and the desired target language (e.g., "es" for Spanish).
              • Replace the original text in your report elements with the translated text using the newly created column or measure.
    5. Load the translated data into Power BI:
      • After applying the translation in Power Query Editor, click "Close & Apply" to load the translated data into your Power BI report.
    6. Use a slicer to select the target language:
      • To allow users to switch between languages, you can create a slicer with language options (e.g., English, Spanish) and use this slicer to filter the visualizations based on the selected language.

    If this helps kindly accept answer for assistance ping in comments thanks much


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.