如何将2列值的计数显示为具有分组值作为行的枢轴表?
我在Excel中有一个数据表,如下所示。
我正在尝试制作一个枢轴表,如下所示,预计每周的数据将增长。
当前的枢轴表使用数据模型,因此我相信我仅限于措施,而没有计算的字段(如果我错了,请正确)。
我尝试创建2个数据模型并基于周创建一个关系,但是由于值不是唯一的,因此不允许使用。获取售出的商品可能是我需要的缺少的作品。我认为应通过创建措施找到添加的项目和已销售项目之间的差异来解决库存列。
我一直在拔头发,试图解决这个问题。我觉得应该有可能,我只是错过了我面前的明显解决方案。
I have a data table in Excel simplified as below.
I am trying to make a Pivot Table as below, with Week Data expected to grow each week.
Current Pivot Table uses Data Models, so I believe I am limited to Measures and no Calculated Fields (correct me if I am wrong).
I have tried creating 2 Data Models and create a relationship based on Week, but it is not allowed since the values are not unique. Getting the Items Sold count might be the missing piece I need. I think Inventory column should be solved by creating a measure to find the difference between Items Added and Items Sold.
I have been pulling my hair out trying to solve this. I feel it should be possible, and I am just missing the obvious solution in front of me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设:
首先在 data之间建立两个关系和 Weeks 表格,一张添加的周列(应为 Active ),而在上售出的一周列(应该是不活动)。
然后创建以下测量:
然后可以将其放在 Week Weeks Weeks 表的 Week 列旁边的枢轴表中。
该表中可能存在(空白)行,如果需要,您可以过滤掉。
Assuming:
First create two relationships between the Data and Weeks tables, one to the Added Week column (which should be active), and one to the Sold Week column (which should be inactive).
Then create the following measures:
which can then be placed in a Pivot Table alongside the Week column from the Weeks table.
A (blank) row may be present in this table, which you can filter out if you wish.