这有效,它选择多个列:
evaluate SELECTCOLUMNS(branches,
"The branch code", branches[code],
"The branch name", branches[name],
"The branch city", branches[city])
这也适用:
evaluate branches
order by branches[name]
start at "Co"
但是,如果我想将两者结合起来,则会出现错误:
evaluate ( SELECTCOLUMNS ( branches,
"The branch code", branches[code],
"The branch name", branches[name],
"The branch city", branches[city]) )
order by branches[name]
start at "Co"
无法确定表“分支”中列“名称”的单个值。当度量公式引用包含许多值的列而未指定汇总(例如最小值,最大值,计数或总和)以获得单个结果时,可能会发生这种情况。
该错误涉及聚合,但是我不需要聚合。有什么问题以及如何解决?
函数SELECTCOLUMNS返回一个表,而ORDER BY引用此新表,而不引用原始表“ branches”。由于新表不包含字段[name],因此会出现错误。要解决此问题,只需参考新表中的字段:
EVALUATE
SELECTCOLUMNS (
branches,
"The branch code", branches[code],
"The branch name", branches[name],
"The branch city", branches[city]
)
ORDER BY [The branch name]
START AT "Co"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句