【发布时间】:2018-10-12 15:36:47
【问题描述】:
我正在尝试在 PowerBi 中为调查数据制定加权平均度量。我目前有以下两个表(简化):
调查数据
ID How would you score the service? Do you agree with X?
---------------------------------------------------------------------------
23 Fair Agree
24 Poor Strongly disagree
25 Fair Agree
26 Very poor *blank*
27 Very good Strongly agree
权重
Weight Score Likert
-------------------------------------------------
1 Very poor Strongly disagree
2 Poor Disagree
3 Fair Neither agree nor disagree
4 Good Agree
5 Very good Strongly Agree
目前'surveydata'[How would you score the service?] 和'weights'[weight] 之间存在关系。
我要计算的加权平均公式如下:
(x1 * w1) + (x2 * w2) + ... (xn * wn)
Weighted Ave = ___________________________________________
x1 + x2 + ... xn
地点:
w = weight of answer choice
x = response count for answer choice
对于上面的示例,我需要两个度量——'surveydata'[How would you score the service?] 的加权平均值和'surveydata'[Do you agree with X?] 的加权平均值。
对于上面的示例,'surveydata'[How would you score the service?] 的加权平均度量值应为 2.8。
请注意,其中一个复杂因素是存在 *blank* 单元格的事实。
任何人都可以建议在 PowerBI 中使用计算度量(或其他方式)执行此操作的方法吗?
【问题讨论】:
标签: powerbi dax weighted-average