基于另一列中不同值的平均值
对于我的项目,我需要创建一个条形图,其中类别轴是汇总和值轴的平均值为rowcount()。 我找不到直接在Bar-ohart中直接计算总和的平均值的方法。
在这里您可以找到所需的步骤计算最终值( 85,26 )。
我使用计算列(在附加的数据集中突出显示)来解决解决方案,但是我需要直接在条形图中计算出来,以便在应用过滤器时会更改。
我试图更好地解释。我的KPI使用以下公式计算:
Sum([Weight]) OVER ([Period],[ID Player],[Player Type],[ID Game],[Player Role])) OVER ([ID
Player],[Player Type],[ID Game],[Player Role])>
平均值是在以下值上完成的:
(83,50 83,50 83,50 83,50 83,50 83,50 83,50 83,50 83,50 86,14 86,14 86,14 86,14 86,14 86,14 86,14 86,14)/16 = 84,82
所以我尝试添加不同的结果,但是结果仍然不正确,因为以下值完成了平均值:
(83,50+86,14)\ 2 = 84,82
平均值应基于“周期”列的不同值
(83,50+86,14+86,14)\ 3 = 85,26
谁能帮助我找到一个公式来获得最后一个平均水平?
提前致谢!
EDIT1:我尝试了一个公式,该公式接近评论中的建议:
Sum([Weight] * [Score]) OVER ([Period],[ID Player],[Player Type],[ID Game],[Player Role]) / Sum([Weight]) OVER ([Period],[ID Player],[Player Type],[ID Game],[Player Role])
,null)) OVER ([ID Player],[Player Type],[ID Game],[Player Role])
For my project I need to create a bar-chart where category axis is the average of an aggregated sum and value axis is rowcount().
I can't find a way to calculate the average of an aggregated sum directly in the bar-chart.
Here you can find the dxp file with steps required to calculate the final value (85,26).
I came to a solution using the calculate columns (highlighted in the dataset attached), but I need to calculate it directly in the bar-chart so it will change when filters are applied .
I tried to explain better. My KPI is calculated using the following formula:
Sum([Weight]) OVER ([Period],[ID Player],[Player Type],[ID Game],[Player Role])) OVER ([ID
Player],[Player Type],[ID Game],[Player Role])>
The average is done on the following values:
(83,50 83,50 83,50 83,50 83,50 83,50 83,50 83,50 86,14 86,14 86,14
86,14 86,14 86,14 86,14 86,14)/16 = 84,82
So I tried to add DISTINCT but the result was still incorrect since the average is done for the following values:
(83,50+86,14)\2 = 84,82
The average should be based on distinct values from "Period" column so
(83,50+86,14+86,14)\3 = 85,26
Can anyone help me to find a formula to obtain the last average?
Thanks in advance!
EDIT1: I tried a formula that's close to the suggestion in the comments:
Sum([Weight] * [Score]) OVER ([Period],[ID Player],[Player Type],[ID Game],[Player Role]) / Sum([Weight]) OVER ([Period],[ID Player],[Player Type],[ID Game],[Player Role])
,null)) OVER ([ID Player],[Player Type],[ID Game],[Player Role])
But it will do the average taking just first values for each period (60+97+97/3=84,67)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定您如何设置可视化,但是类似以下公式可能会起作用
Not sure how you have set up the visualisation, but something like the following formula might work