在功率BI/ DAX中的切片机中,是否有一个函数可以将平均值和平均值汇总在一起?

发布于 2025-01-23 07:03:47 字数 2009 浏览 0 评论 0原文

我想以平均每月的平均数量(每支或多个团队总数)进行视觉效果(同时保持日期hierachy每天显示数据)。
我有一张每天每天每天数量的桌子。

日期数量
1-1-20221 251 25
1-1-1-2022225
1-1-2022325
1-1-2022425
2-1-2022125
2-1-2022225
2 25 2-1-2022323
2-1-2022415
3-1-2022127
3-1-2022229
3-1-2022323
3-1-2022415
4-1-2022127
4-1-2022294-1-2022
319
4-1-2022415
.. ...... ..
31-1-2022125
31-1-2022210
31-1-2022315
31-1-2022429


(See excel example below)
At the moment i'm using the [amount] and [date] fields to feed he visual, no measures.
The user can select one or many teams with a slicer to show different averages per month. Selecting one team gives the desired result.
But...
Selecting two or more teams gives a logical, but undesired result. It shows the average of team averages per month. Desired would be to see the sum of averages per team per month.

即IE如果第一个月,团队1-4的平均值为25 23.5 22.7 27.5所有团队的结果现在为24.68(AVG的AVG)。 期望的是98,7(AVG之和)

是否有一种方法可以通过DAX度量进行操作?

I'd like to make a visual with average amount (totalled per one or more teams) per month (while keeping date hierachy to show data per day).

I have a table with amount per team per day.

DateteamAmount
1-1-2022125
1-1-2022225
1-1-2022325
1-1-2022425
2-1-2022125
2-1-2022225
2-1-2022323
2-1-2022415
3-1-2022127
3-1-2022229
3-1-2022323
3-1-2022415
4-1-2022127
4-1-2022229
4-1-2022319
4-1-2022415
......
31-1-2022125
31-1-2022210
31-1-2022315
31-1-2022429





(See excel example below)

At the moment i'm using the [amount] and [date] fields to feed he visual, no measures.

The user can select one or many teams with a slicer to show different averages per month.
Selecting one team gives the desired result.

But...

Selecting two or more teams gives a logical, but undesired result.
It shows the average of team averages per month.
Desired would be to see the sum of averages per team per month.

ie if for the first month team 1-4 have averages of 25 23.5 22.7 and 27.5 the result of all teams is now 24.68 (avg of avg).
Desired would be 98,7 (sum of avg)

Is there a way to do this with a dax measure?

Data per team per day

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我做我的改变 2025-01-30 07:03:47

为什么使用迭代器?似乎粒度与桌子中的粒度相同。您可以简单地使用平均,然后使用全部删除上下文过渡。

dax计算

Avg. =
CALCULATE ( AVERAGE ( 'Table'[Amount] ), ALL ( 'Table'[Date] ) )

输出

“在此处输入图像描述”

Why are you using an iterator? Seems like the granularity is the same as the one in the table. You can simply use AVERAGE and remove context transition with ALL.

DAX Calculation

Avg. =
CALCULATE ( AVERAGE ( 'Table'[Amount] ), ALL ( 'Table'[Date] ) )

Output

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文