简体   繁体   English

Excel 数据透视表,计算筛选值的总值百分比

[英]Excel Pivot Tables, Calculating a Percentage of Total Values for filtered values

I have a table (below) and I would like to display the percentage in the column "Count of Value" I can do this but however if I filter the results the percentage applied is only to the filtered data.我有一个表格(如下),我想在“值计数”列中显示百分比我可以这样做,但是如果我过滤结果,应用的百分比仅适用于过滤后的数据。 In here instead of getting what I need which is the percentage of won leads by month (Jan 50% and Feb 75%) I get the percentage based on the total won leads (5, which were 3 in Feb and 3 in Jan 60/40).在这里,我没有得到我需要的,即按月(1 月 50% 和 2 月 75%)赢得潜在客户的百分比,而是根据赢得的潜在客户总数(5,2 月 3 和 60 年 3 月)获得百分比40)。

I'm not good with Excel at all, I'm trying to help the sales manager with this for 2 days and I can't calculate the totals.我根本不擅长 Excel,我试图帮助销售经理解决这个问题 2 天,但我无法计算总数。 I've learned a bit about Excel but I can't figure out how to do this without doing it manually which will be a big pain in the backside.我对 Excel 有了一些了解,但如果不手动执行,我无法弄清楚如何做到这一点,这将是一个很大的麻烦。

Any help would be greatly appreciated.任何帮助将不胜感激。

Thank you.谢谢你。

Excel 表和数据透视表

潜在客户百分比

This is how you can get it done in Excel 2016+ (screenshots are in spanish, but serve as a guide).这是在 Excel 2016+ 中完成它的方法(屏幕截图为西班牙语,但可作为指南)。

Based on this setup:基于此设置:

在此处输入图片说明

Steps:脚步:

1) Convert your data to an Excel structured table 1) 将您的数据转换为 Excel 结构化表格

  • Select the data range选择数据范围
  • Click Home |点击首页 | Format as Table |格式为表格 | mark (Use headers)标记(使用标题)

在此处输入图片说明

2) Add table to Power Query - With table selected, click Data | 2) 将表添加到 Power Query - 选择表后,单击数据 | From table or range 从表或范围

3) Adjust data types for each column - Click on the icon in the columns headers and select the appropiate data type - In this case, make sure Date table is set to the date type 3) 调整每列的数据类型 - 单击列标题中的图标并选择合适的数据类型 - 在这种情况下,确保日期表设置为日期类型

在此处输入图片说明

4) Click Close and Load (the option that expands) and select Close and load to 4) 单击关闭并加载(展开的选项)并选择关闭并加载到

在此处输入图片说明

5) Select "Connection only" and check the "Add to data model" checkbox (and click ok) 5)选择“仅连接”并选中“添加到数据模型”复选框(然后单击确定)

在此处输入图片说明

6) Click on Data | 6) 点击数据 | Manage data model管理数据模型

在此处输入图片说明

7) On the table (which should be called Table1 if you didn't rename it) select the first cell of the grid below the data 7)在表格(如果你没有重命名它应该被称为Table1)上选择数据下面的网格的第一个单元格

在此处输入图片说明

8) Add the following text to the formula bar and click enter 8)在公式栏中添加以下文字,点击回车

Percentage won by month:=COUNTROWS(Tabla1) / CALCULATE(COUNTROWS(Tabla1);all(Tabla1[Lead stage]))

在此处输入图片说明

9) Close the windows and go back to Excel 9) 关闭窗口并返回 Excel

10) In a new blank sheet click Insert | 10) 在新的空白表中单击插入 | Pivot Table数据透视表

在此处输入图片说明

11) Make sure Use Data Model is selected and click Ok 11) 确保选择使用数据模型并单击确定

在此处输入图片说明

12) Add the fields to the pivot table, making sure the measure you added "Percentage won by month" is in the values section 12) 将字段添加到数据透视表,确保您添加的度量“按月赢得的百分比”在值部分

在此处输入图片说明

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

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