简体   繁体   English

Excel 2013 PowerPivot表-许多事实表以及计算字段

[英]Excel 2013 PowerPivot Table - Many Fact Tables along with a Calculated Field

I am pretty new on creating POWERPIVOT tables. 我是创建POWERPIVOT表的新手。 I have searched for a bit of time now to resolve this problem but I have been unsuccessful so far. 我已经搜索了一些时间来解决此问题,但是到目前为止,我一直没有成功。 Here is my problem. 这是我的问题。 As you can see below, I have created a POWERPIVOT table in Excel 2013 that is composed of two FACT tables, which are based on: 1) a sheet where the clients can insert initial budget entries; 如下所示,我在Excel 2013中创建了一个POWERPIVOT表,该表由两个FACT表组成,这些表基于:1)工作表,客户可以在其中插入初始预算条目; and, 2) another sheet where the clients can insert the post-initial budget entries. 2)客户可以在其中插入初始预算后条目的另一张表。 Also, a DIMENSION table has been added to the combination in order to add the following relationships: 另外,已将DIMENSION表添加到组合中,以添加以下关系:

Based on these relationships, I have clicked on Insert a PivotTable to create the following POWERPIVOT table that will be used to display the Initial Budget and Adjustments entries for analysis purposes. 基于这些关系,我单击了“插入数据透视表”以创建以下POWERPIVOT表,该表将用于显示“初始预算”和“调整项”以进行分析。 However, this table does not give me the total of both columns. 但是,此表没有给我这两列的总数。 I have thought that a calculated field would make it happen but this is where I am stucked as nothing let me sum the two columns like I was used to do with regular pivot tables in Excel 2007. The calculation of the two columns would logically equal the Current Budget as shown attached. 我以为可以通过计算字段来实现,但这是我无法解决的问题,因为没有什么像我以前在Excel 2007中使用常规数据透视表那样对两列进行求和。逻辑上,两列的计算等于当前预算如下图所示。

Thank you for your help on this. 感谢您的协助。

With Power Pivot you don't use the calculated field feature of pivot table. 使用Power Pivot,您无需使用数据透视表的计算字段功能。 You have to put a measure in your data Modell, which you can then add in the value part of the PT. 您必须在数据Modell中放置一个度量,然后可以将其添加到PT的值部分中。 Relationships alone are not enough. 单靠关系是不够的。

currentBudget := CALCULATE (
    SUM ( fInitialBudget[Initial Budget] ) + SUM ( fAdjustement[Adjustements] )
)

if you are new with Power Pivot, I warmly recommend the book of Rob Collie "DAX Formulas for Power Pivot" . 如果您是Power Pivot的新手,我热烈推荐Rob Collie的书“ Power Pivot的DAX公式” I got a very good introduction of the PP capability with it. 我对PP的功能有了很好的介绍。 The 2nd Edition is on the way. 第二版即将推出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM