PowerPivot - 如何过滤维度以获得价值
我正在处理具有以下表格/关系的 PowerPivot 报表:
FactTable:
- SponsorId
- OfficeId
- 类型
- 颜色
- 数量
DimSponsor:
- SponsorId
- SponsorName
- ProjectName
DimOffice:
- OfficeId
- 区域
- 国家/地区
- 经理
- NumberEmployees
两个维度表中的每一个都存在 FactTable 关系。
我希望创建一个计算度量,即 SUM(Quantity)/SUM(NumberEmployees),它表示按员工数量处理的平均项目数。
我相信我遇到了此处列出的 PowerPivotPro FAQ< /a>
当我创建一个 X 轴为 [Region] 且以 [NumberEmployees] 作为唯一值的数据透视表时,它始终显示所有 [NumberEmployees] 的总和,无论任何切片器选择(在本例中,我创建了 [SponsorName] 的水平切片器)。
我是 DAX 新手,一直在努力寻找满足我需求的公式。这个问题有什么解决办法吗?
I am working on a PowerPivot report that has the following tables/relationships:
FactTable:
- SponsorId
- OfficeId
- Type
- Color
- Quantity
DimSponsor:
- SponsorId
- SponsorName
- ProjectName
DimOffice:
- OfficeId
- Region
- Country
- Manager
- NumberEmployees
Relationships exist FactTable to each of the two dimension tables.
I wish to create a calculated measure that is the SUM(Quantity)/SUM(NumberEmployees) which represents the average number of items processed by number of employees.
I believe I am having the problem listed here at PowerPivotPro FAQ
When I create a pivot table that has an X-Axis of [Region] with [NumberEmployees] as the only value it always displays the sum of ALL [NumberEmployees] regardless of any slicer selection (in this case, I created a horizontal slicer of [SponsorName]).
I am new to DAX and have struggled to find a formula to meet my needs. Is there any solution to this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 马克·鲁索的斑点。问题是创建一个自定义度量,通过 FactTable 中已过滤的行来过滤 Office 表。
正如页面上的一些评论所提到的,它不像拖放那么容易,但它确实有效。
I found working examples of what I needed to accomplish on Marc Russo's blob. It is a matter of creating a custom measure that filters the Office table by the already filtered rows of FactTable.
As some of the comments on the page mention, it isn't as easy as drag-n-drop but it works.