计算两个分组平均值之间的差异?

Calculate the Difference Between two Grouped Averages?

在 Power BI 中工作,我试图找到两个不同组的平均数,然后计算它们之间的差异。以下是数据示例:

[

ID      Item        Misc        Score.I
R.3     Searching   N/A         0
R.3     Discovering N/A         0
R.3     Creation    Email       3.1
R.3     Duplicate   Mailbox     1.9
R.3     Duplicate   Connection  2.8
R.3_FS  Searching   N/A         0
R.3_FS  Discovering N/A         0
R.3_FS  Creation    Email       2.8
R.3_FS  Duplicate   Mailbox     2.8
R.3_FS  Duplicate   Connection  2.5

例如,我想求出每个 ID 的平均值 Score.i,然后显示这两个值之间的差值。关于完成此操作的最简单方法的任何想法?

您可以创建 3 个度量 - ID = R.3 的平均值,ID = R.3_FS 的平均值,以及前两者之间的差异:

Average R.3 = AVERAGEX(FILTER('Table'; 'Table'[ID] = "R.3"); 'Table'[Score.I])

Average R.3_FS = AVERAGEX(FILTER('Table'; 'Table'[ID] = "R.3_FS"); 'Table'[Score.I])

Difference = [Average R.3] - [Average R.3_FS]

其中 Table 是您的 table 的名称。请注意,您可能必须使用 , 而不是 ; 作为参数分隔,具体取决于您的区域设置。