在M的以下查询中获取错误消息,我尝试在合并步骤之前拆分为2个不同的查询,但仍收到“此操作无法直接访问数据源,请重建数据组合”错误>
*let
Source = #"Query List from SP",
cols = if {"Type"} = "Indicator" then 4 else 5,
DataLoad = (path) =>
let
Doc =
Csv.Document(
Web.Contents(
BaseUrl,
[Headers =[#"Content-type"="text/csv",
#"Authorization"="Basic " & Credential],
RelativePath=path
]), [Delimiter=",", Columns=cols, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Doc, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Data", type text}, {"Organisation unit", type text}, {"Period", type text}, {"Value", type number}}
)
in
#"Changed Type",
out = Table.AddColumn(
Source,
"res",
each DataLoad([Path])
),
#"Removed Errors" = Table.RemoveRowsWithErrors(out, {"res"}),
#"Expanded res" = Table.ExpandTableColumn(#"Removed Errors", "res", {"Data", "Category option combo", "Organisation unit", "Period", "Value"}, {"Data", "Category option combo", "Organisation unit", "Period.1", "Value"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded res",{"GUIDs", "Period", "BaseUrl", "Credential", "Path"}),
#"Changed Type" = Table.TransformColumnTypes(#"Removed Columns",{{"Value", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Period.1", "Period"}}),
#"Replace Cat" = Table.RenameColumns(Table.RemoveColumns(Table.AddColumn(#"Renamed Columns", "colnew", each if [Data] = "VbgQkVibB4P" then "qCWoTDpiKeH"
else if [Data] = "YfCLQ1zig8z" then "qCWoTDpiKeH"
else if [Data] = "M6kVOHWcnK3" then "qCWoTDpiKeH"
else if [Data] = "Wov7FpjPr4E" then "qCWoTDpiKeH"
else if [Data] = "MTuFYrvAacn" then "qCWoTDpiKeH"
else if [Data] = "uXuoTc5nxkd" then "qCWoTDpiKeH"
else if [Data] = "DsLkV0VYy6q" then "qCWoTDpiKeH"
else [Category option combo]),{"Category option combo"}),{{"colnew", "Category option combo"}}),
#"Inserted Merged Column" = Table.AddColumn(#"Replace Cat", "deco key", each Text.Combine({[Data], [Category option combo]}, "."), type text),
#"Added Index" = Table.AddIndexColumn(#"Inserted Merged Column", "Index", 1, 1)
in
#"Added Index"*
答案 0 :(得分:0)
由于要链接到查询#"Query List from SP"
,因此不会直接访问数据源。
有关此主题的文章很多。克里斯·韦伯(Chris Webb)拥有与数据隐私设置有关的整个blog series,但是摆脱此问题的最简单方法是简单地忽略隐私级别。
转到文件菜单下的选项和设置:
在“隐私”部分下,选择忽略隐私级别:
很显然,如果您要构建一些需要仔细管理隐私级别的东西,那么这是错误的方法,您需要更加小心。但是,当隐私级别无关紧要时,这是一个简单方便的解决方法