如果您使用 Power Query 已有一段时间,那么您可能已经体验过了。 当突然出现一个错误,再多的在线搜索、查询调整或键盘敲击都无法纠正时,您就可以查询了。 像这样的错误:
Formula.Firewall: Query 'Query1' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
或者:
Formula.Firewall: Query 'Query1' (step 'Source') is accessing data sources that have privacy levels which cannot be used together. Please rebuild this data combination.
这些Formula.Firewall错误是 Power Query 的数据隐私防火墙(也称为“防火墙”)造成的,有时它的存在似乎只是为了让全世界的数据分析师感到沮丧。 不管您信不信,防火墙有着重要的作用。 在本文中,我们将深入探讨它的工作原理。 有了更深入的了解,您将有望在将来更好地诊断和修复防火墙错误。
Formula.Firewall: Query 'Query1' (step 'Source') is accessing data sources that have privacy levels which cannot be used together. Please rebuild this data combination.
Formula.Firewall: Query 'Query1' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
shared DbServer = "MySqlServer" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=true];
Power Query M
shared Contacts = let
Source = Csv.Document(File.Contents("C:\contacts.txt"),[Delimiter=" ", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"ContactID", Int64.Type}, {"NameStyle", type logical}, {"Title", type text}, {"FirstName", type text}, {"MiddleName", type text}, {"LastName", type text}, {"Suffix", type text}, {"EmailAddress", type text}, {"EmailPromotion", Int64.Type}, {"Phone", type text}, {"PasswordHash", type text}, {"PasswordSalt", type text}, {"AdditionalContactInfo", type text}, {"rowguid", type text}, {"ModifiedDate", type datetime}})
in
#"Changed Type";
想象一下,您想从 Northwind OData service 服务中查找一个公司名称,然后使用该公司名称执行必应搜索。
首先,创建 Company 查询以检索公司名称。
Power Query M
let
Source = OData.Feed("https://services.odata.org/V4/Northwind/Northwind.svc/", null, [Implementation="2.0"]),
Customers_table = Source{[Name="Customers",Signature="table"]}[Data],
CHOPS = Customers_table{[CustomerID="CHOPS"]}[CompanyName]
in
CHOPS
接下来,创建一个 Search 查询,该查询引用 Company,并将其传递给必应。
Power Query M
let
Source = Text.FromBinary(Web.Contents("https://www.bing.com/search?q=" & Company))
in
Source
此时,您遇到了麻烦。 评估 Search 产生防火墙错误。
Formula.Firewall: Query 'Search' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
Demuestre los aspectos básicos de la seguridad de los datos, la administración del ciclo de vida, la seguridad de la información y el cumplimiento para proteger una implementación de Microsoft 365.
Un artículo completo sobre los conceptos de tipos de datos en Power Query, cómo definir tipos de datos para los valores y la importancia de los tipos de datos.
Obtenga información sobre cómo corregir valores anidados que se convierten en una cadena cuando se usa una configuración de privacidad del origen de datos incorrecta.