[英]Changing Average Formula in pivot table depending on filter
I have a group of data with the following fields: Code, Product, Rate, Volume 我有一组包含以下字段的数据:代码,产品,费率,数量
Each code has multiple products. 每个代码都有多个产品。 On each row of the pivot table is a code, and the table has a product filter. 数据透视表的每一行上都有一个代码,并且该表具有产品过滤器。 The Rate is the value in the table. 比率是表中的值。 I want that rate to change depending on a combination of products selected. 我希望该汇率根据所选产品的组合而变化。
EG If Code A has: EG如果代码A具有:
I want the rate field to display 2.4% when all are selected, 2.75% when A&B are selected, 1.5% when A&C are selected and 2.5% when B&C are selected. 我希望比率字段在全部选中时显示2.4%,在选择A&B时显示2.75%,在选择A&C时显示1.5%,并且在选择B&C时显示2.5%。
How do I do this? 我该怎么做呢? Currently, I am only able to have the rate field display an average or a sum, which is not right. 目前,我只能使“费率”字段显示平均值或总和,这是不正确的。 IE in the above example, average would display 2%, which is not accurate. 在以上示例中,IE的平均值将显示2%,这是不准确的。
Its a little convoluted, but I think this gets at what you want. 它有点令人费解,但是我认为这可以满足您的需求。
Analyze>Calculations>Fields Items & Sets> Calculated Field
选择数据透视表,然后转到“ Analyze>Calculations>Fields Items & Sets> Calculated Field
Weighted Average
then for your formula enter Helper/Volume
, then select Add
将新字段命名为“ Weighted Average
然后为您的公式输入Helper/Volume
,然后选择Add
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.