Power BI度量:为每个ID找到平均总支出
我想在Power BI中创建一个量度,以找到每个ID的总_spend的平均值。我的桌子看起来像这样:
id | total_spend |
---|---|
1234 | £34.00 |
1234 | £34.00 |
1234 | £34.00 |
4325 | £56.00 |
4325 | £56.00 |
4325 | £43.00 43.00 |
4325 | £43.00 |
5678 | £12.00 |
5678 | £12.00 |
我尝试了:
AvgIDSpend=
AVERAGEX (
SUMMARIZE (
Table,
Table[ID],
"Total Average", SUM( DISTINCT ( Table[Total_spend] )
),
[Total Average]
)
但是得到了此错误 -函数仅接受列参考作为参数。
I want to create a measure in Power Bi that finds the average of the total_spend for each ID. My table looks like this:
ID | Total_Spend |
---|---|
1234 | £34.00 |
1234 | £34.00 |
1234 | £ 34.00 |
4325 | £ 56.00 |
4325 | £ 56.00 |
4325 | £ 43.00 |
4325 | £ 43.00 |
5678 | £ 12.00 |
5678 | £ 12.00 |
I've tried:
AvgIDSpend=
AVERAGEX (
SUMMARIZE (
Table,
Table[ID],
"Total Average", SUM( DISTINCT ( Table[Total_spend] )
),
[Total Average]
)
But got this error- The SUM function only accepts a column reference as an argument.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最快的方法就是创建一个计算
表[total_spend]
的平均值的度量。首先,措施:
然后,您创建一个带有列的新表Visual:
table [id]
table [avg_total_spend]
or作为表expression:
The quickest way to do it would be to just create a measure that calculate the average of
Table[Total_spend]
, and then use it in a table visual alongsideTable[ID]
.First, the measure :
Then, you create a new table visual with columns:
Table[ID]
Table[Avg_Total_spend]
Or, as a table expression :