Forum Discussion

DSirisha's avatar
DSirisha
Regular Visitor
1 month ago
Solved

Power BI Service Refresh Error: Unable to combine data (Azure SQL and Google Translate API Privacy L

Hi everyone,
I am trying to add a custom column in Power Query (M code) that calls the Google Translate API to translate a text column. The main source table is hosted in Azure SQL Database.
This setup works perfectly fine and refreshes without any issues in Power BI Desktop. However, after publishing the report to the Power BI Service, the scheduled refresh fails with the following gateway mashup error:
[Unable to combine data] Section1/tablename/Added Custom2 is accessing data sources that have privacy levels which cannot be used together. Please rebuild this data combination.
What I have tried so far:
  • In Power BI Desktop, I went to File -> Options and Settings -> Current File -> Privacy and enabled "Ignore Privacy Levels and improve performance." This fixes it locally, but the error still persists in the cloud service.
Is the Google Translator API inherently incompatible with Azure SQL data sources in the Power BI Service, or is there a specific way I need to configure the privacy levels or rewrite my M code to fix this?I also tried with  Relative Path  option in Mcode.
Can anyone help on this and please give any sugestions how to resove this issue.
  • Hi,

    Thanks for sharing the M code. Your implementation looks correct from a Power Query perspective, and using Table.Buffer() is a good optimization. However, the issue is not with the M syntax—it's with how Power BI Service handles privacy and data source combinations.

    In your code:

    BufferedTable = Table.Buffer(#"Source")

    BufferedTable only buffers the Azure SQL data in memory. When Table.AddColumn() calls:

    Web.Contents(

        "https://translate.googleapis.com",

        ...

    )

    Power BI Service still sees this as combining Azure SQL with a Web data source for every row. During scheduled refresh, the Mashup Engine enforces privacy rules and blocks this combination, resulting in the "Unable to combine data" error.

    A few recommendations:

    • Verify that both the Azure SQL source and the Google Translate API are configured with the same privacy level (preferably Organizational) in the dataset settings.
    • If you're using an On-premises Data Gateway, ensure both data sources are configured there with valid credentials.
    • Table.Buffer() and RelativePath improve performance and are best practices, but they do not bypass Power BI Service privacy restrictions.
    • If the dataset contains many rows, calling Web.Contents() once per row is also likely to hit refresh/performance limitations.

    For production scenarios, the recommended approach is to move the translation outside Power BI, for example:

    • Translate the data before loading it into Azure SQL.
    • Use Azure Functions, Power Automate, Dataflows, or an ETL process to populate a translated column.
    • Import the translated data directly into Power BI instead of invoking the API during refresh.

    Based on the M code you've shared, this appears to be a Power BI Service privacy/mashup limitation rather than an issue with your code.

    Hope this helps!

     

    Thanks!

6 Replies

  • Hi,

     

    This is a common limitation in Power BI Service when combining data from multiple sources (Azure SQL + Web API).

    The key point is that "Ignore Privacy Levels and improve performance" only works in Power BI Desktop. After publishing, Power BI Service enforces privacy levels and data source isolation during refresh.

    A few things to check:

    1. Verify Privacy Levels in Power BI Service

    Go to:
    Dataset Settings → Data Source Credentials

    Ensure both:

    • Azure SQL Database
    • Google Translate API (Web source)

    have compatible privacy levels (typically Organizational).

    1. API Calls Inside Row-by-Row Custom Columns

    If your M code calls Google Translate for each row, Power BI Service may treat this as combining data from:

    • Azure SQL
    • Web API

    which often triggers the "Unable to combine data" error.

    1. Buffer the SQL Data

    Try buffering the SQL table before calling the API:

    BufferedTable = Table.Buffer(Source)

    This sometimes helps Power Query treat the SQL data as local before invoking the web request.

    1. Consider Moving Translation Outside Power Query

    For production scenarios, a better approach is often:

    • Translate data before loading into Power BI
    • Use Azure Functions, Power Automate, Dataflow, or SQL ETL processes
    • Store the translated text in a table and import it directly
    1. Gateway Considerations

    If you're using an On-Premises Data Gateway:

    • Ensure both sources are configured correctly in the gateway
    • Verify credentials are valid
    • Check gateway logs for additional mashup engine details
    1. RelativePath Does Not Solve Privacy Conflicts

    Using RelativePath is recommended for dynamic web requests, but it does not bypass Power BI Service privacy-level restrictions.

    Bottom Line

    The issue is not that Google Translate API is incompatible with Azure SQL. The problem is that Power BI Service is enforcing privacy isolation between the SQL source and the Web API call. The most reliable solutions are:

    • Set both sources to compatible privacy levels.
    • Buffer the source data before API calls.
    • Move the translation logic outside Power BI refresh (recommended for large datasets).

    If you can share the relevant M code (especially the Web.Contents call), the community can provide a more targeted solution.

     

    Thanks!

     

    • DSirisha's avatar
      DSirisha
      Regular Visitor

      below M Code is using in my report
      BufferedTable = Table.Buffer(#"Source"),
      TranslateText = (inputText as text) as any =>
      let
      jsonResponse =
      try Json.Document(
      Text.FromBinary(
      Web.Contents(
      "https://translate.googleapis.com",
      [
      RelativePath = "translate_a/single",
      Query = [
      client = "gtx",
      sl = "auto",
      tl = "en",
      dt = "t",
      q = inputText
      ],
      ManualStatusHandling = {400, 404, 500}
      ]
      )
      )
      )
      otherwise null,
      translatedText =
      if jsonResponse <> null
      and List.NonNullCount(jsonResponse) > 0
      and List.NonNullCount(List.First(jsonResponse)) > 0
      then
      try List.First(List.First(jsonResponse)){0}
      otherwise null
      else
      null
      in
      translatedText,
      #"Added Custom1" = Table.AddColumn(
      BufferedTable,
      "Translated",
      each if [ResponseShortText] <> null and [ResponseShortText] <> ""
      then TranslateText([ResponseShortText])
      else null
      )

      • SamInogic's avatar
        SamInogic
        Super User

        Hi,

        Thanks for sharing the M code. Your implementation looks correct from a Power Query perspective, and using Table.Buffer() is a good optimization. However, the issue is not with the M syntax—it's with how Power BI Service handles privacy and data source combinations.

        In your code:

        BufferedTable = Table.Buffer(#"Source")

        BufferedTable only buffers the Azure SQL data in memory. When Table.AddColumn() calls:

        Web.Contents(

            "https://translate.googleapis.com",

            ...

        )

        Power BI Service still sees this as combining Azure SQL with a Web data source for every row. During scheduled refresh, the Mashup Engine enforces privacy rules and blocks this combination, resulting in the "Unable to combine data" error.

        A few recommendations:

        • Verify that both the Azure SQL source and the Google Translate API are configured with the same privacy level (preferably Organizational) in the dataset settings.
        • If you're using an On-premises Data Gateway, ensure both data sources are configured there with valid credentials.
        • Table.Buffer() and RelativePath improve performance and are best practices, but they do not bypass Power BI Service privacy restrictions.
        • If the dataset contains many rows, calling Web.Contents() once per row is also likely to hit refresh/performance limitations.

        For production scenarios, the recommended approach is to move the translation outside Power BI, for example:

        • Translate the data before loading it into Azure SQL.
        • Use Azure Functions, Power Automate, Dataflows, or an ETL process to populate a translated column.
        • Import the translated data directly into Power BI instead of invoking the API during refresh.

        Based on the M code you've shared, this appears to be a Power BI Service privacy/mashup limitation rather than an issue with your code.

        Hope this helps!

         

        Thanks!

  • Hi DSirisha

     

    THis has nothing to do with the M code in your report. 

    YOu need to make sure that all connections used are set as the "organizational" privacy level in the service. Modify all connections to be the same and your report will work. 

  • v-saisrao-msft's avatar
    v-saisrao-msft
    Community Support

    Hi DSirisha,

    Checking in to see if your issue has been resolved. let us know if you still need any assistance.

     

    Thank you.

  • v-saisrao-msft's avatar
    v-saisrao-msft
    Community Support

    Hi DSirisha,

    Checking in to see if your issue has been resolved. let us know if you still need any assistance.

     

    Thank you.