我正在尝试使用以下DAX公式作为计算表: 它说无法识别包含ValueToSum的表。 如果我使用GENERATE将系列交叉连接到表格,也会发生同样的情况。 为什么这不起作用? 我怎么能让它发挥作用? ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
我正在尝试在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'[How would you score the service?]
和'surveydata'[How would you score the service?]
的加权平均值'surveydata'[Do you agree with X?]
。
对于上面的示例, 'surveydata'[How would you score the service?]
的加权平均数应为2.8。
请注意,并发症之一是存在*空白*单元格的事实。
谁能在PowerBI中提出一种通过计算的度量(或其他方法)做到这一点的方法?
您可以将SurveyData
表中每一行的权重相加,然后除以行数
Weighted Ave =
DIVIDE(
SUMX(SurveyData, RELATED(Weights[Weight])),
COUNTROWS(SurveyData)
)
或者简单地使用平均函数
Weighted Ave = AVERAGEX(SurveyData, RELATED(Weights[Weight]))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.