使用 Dax 查询:'(' 的语法不正确

Querying with Dax: The syntax for '(' is incorrect

我正在尝试根据另一列的过滤器获取行子集的列值的平均值。

var mdX = @"CALCULATE(AVERAGE('Table'[Column1]),FILTER('Table','Table'[Column2] = 'bla'))";

using (AdomdCommand command = new AdomdCommand(mdX, connection))
{
      var result = command.ExecuteReader();
}

但我收到一条无用的错误消息:

Query (1, 10) The syntax for '(' is incorrect. (CALCULATE(AVERAGE('Table'[Column1]),FILTER('Table','Table'[Column2] = 'bla'))).

通常,DAX 表达式以 something = 开头,但由于您只想要结果,请尝试在开头添加 EVALUATE

"EVALUATE CALCULATE(AVERAGE('Table'[Column1]),FILTER('Table','Table'[Column2] = 'bla'))"