excel - 如何避免 Power Query Formula.Firewall 权限错误?

标签 excel powerquery

我在 Microsoft Excel 365 版本 2301 中使用 Power Query。 我有一个包含 2 列标识符的表,从网络源(REST API)中提取。它看起来像这样:

#“标识符”

let
    Source = #table(
        {"id_a", "id_b"},
        {
            {1234, 9813},
            {1096, 3018},
            {2841, 3852}
        }
    )
in
    Source

我有一个函数可以将这些标识符转换为网络查询字符串 create_query_string =(id_a 作为数字,id_b 作为数字)作为文本 => ...

以及一个使用该查询字符串执行 Web 查询并返回结果列表的函数 my_web_query = (url as text, query_string as text, api_key as text) as list => ...

我使用它们添加一个包含该查询结果的新列

#"查询1"

let
    Source = Table.Buffer(#"Identifiers"),
    #"Added Custom" = Table.AddColumn(
        Source,
        "web query",
        each create_query_string([id_a], [id_b])
    ),
    #"Added Custom1" = Table.AddColumn(
        #"Added Custom",
        "results", 
        each my_web_query(
            "https://my.website.com/rest_api",
            [web query],
            "my_api_key"
        )
    )
in
    #"Added Custom1"

这可以正确执行,但是当我连续选择其中一个 [List] 结果时,出现以下公式防火墙错误:

Formula.Firewall:查询“Query1”(步骤“已添加自定义1”)引用其他查询或步骤,因此它可能无法直接访问数据源。请重建此数据组合。

我可以看到的所有数据源都设置为相同的隐私级别:“组织” 我需要做什么才能查看查询结果?

最佳答案

微软推荐了2种解决方案。 https://learn.microsoft.com/en-us/power-query/data-privacy-firewall

  1. “扁平化”您的查询,以便每个查询从每个数据库中提取所需的所有信息
  2. 关闭数据隐私防火墙。

我不喜欢这两个选项,但是#1 会导致我为每个查询重新提取相同的数据。

我选择了选项 2,因为(在我的特定情况下)所有数据源都来 self 的组织内部。

enter image description here

关于excel - 如何避免 Power Query Formula.Firewall 权限错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76283170/

相关文章:

excel - 从 Excel VBA 在 Word 中编写项目符号列表

c# - 在 C# 中格式化 Excel 中多行的最快方法

powerquery - 使用电源查询在 Excel 中将 "section-document"写入何处?

excel-2013 - Power Query 转置表

excel - 使用 office.js 隐藏 Excel 工作簿中的行

具有条件值的 Excel 列公式

powerquery - 将字符串中的多个单词替换为列表中的特定单词

excel - Power Query 根据另一列转换一列

excel - 如何将 Power Query 表保存为新工作簿中的常规表(无连接)?

php - Laravel Excel - 仅返回行的第一列