简体   繁体   English

数据透视表总和项目,但平均总计

[英]Pivot Table Sum Items, But Average Grand Total

I have a Standard Pivot Table it has Date from the Columns and Numbers in the Value,我有一个标准数据透视表,它有来自值中的列和数字的日期,

Column: Date |列:日期 | Numbers数字

I want the Numbers in the Rows to be Calculated as Sum, but I want the Grand Total to Average those Sums Rows我希望将行中的数字计算为总和,但我希望总计计算这些总和行的平均值

How is this possible?这怎么可能?

Assuming you have PowerPivot, which you should if you have 2016, and assuming a table called Table1 loaded into the data model, you can add a measure for the sum, called say TotalNumber , which is just:假设您有 PowerPivot,如果您有 2016 年就应该这样做,并假设一个名为 Table1 的表加载到数据模型中,您可以为总和添加一个度量值,称为TotalNumber ,它只是:

=SUM(Table1[Numbers])

Then add another measure which is the one you'll use in the pivot table:然后添加另一个度量,这是您将在数据透视表中使用的度量:

=IF(HASONEVALUE(Table1[Date]),[TotalNumber],averagex(VALUES(Table1[Date]),Table1[TotalNumber]))

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

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