简体   繁体   中英

Pivot Table on Excel - Summarize data

Im working with a table similar to this one:

在此处输入图像描述

I want to create a pivot table that organizes the data by the "GRUPO" column, indicating the reason for leaving a company.

For example, in the table above, DK would have to have SALARIO = 2 (there are 2 people in group DK who between RAZÓN 1 and RAZÓN 2 have checked SALARIO).

I manage to do something like this:

在此处输入图像描述

But is not working correctly, as you see, i only want the final result for each RAZÓN...

Any help? Thanks!

Well, there might be other ways to accomplish this task, however this is what i usually do, since i found it easy one for me, so you can follow the steps and refer image as well,

1.) Select any cell within the table ie your ORIGINAL DATA SOURCE ,

原始来源数据

2.) Now from Data Tab --> Goto --> Get & Transform Data Group --> From there click --> From Table/Range ,

数据选项卡 - 获取和转换数据

3.) On selecting the one i have mentioned above, shall open the Power Query Editor ,

电源查询编辑器窗口

4.) From Query Settings Panel, under PROPERTIES change the name to Grupotbl

集团公司

5.) Now select any column and press CTRL A to select the whole table to change the data type, from TRANSFORM TAB --> Under Any Column Group --> Click Detect Data Type, this shall add one step in the APPLIED STEPS as Changed Type ,

更改类型

6.) Next select the first three columns and right click & select --> Unpivot Other Columns , eventually adding one steps under APPLIED STEPS as Unpivoted Other Columns

未透视的其他列

7.) Now rename the column Value as Razon

将列重命名为 RAZON

8.) Press CTRL and select the columns other than column named Attribute , right click Remove Other Columns ,

删除了其他列

9.) From HOME TAB under Close click the dropdown and click Close & Load To ,

关闭并加载到

10.) On doing above, you shall get this and click Only Create Connection and check the Add this data to the Data Model --> Press Ok,

导入数据

11.) From Insert Tab --> Pivot Table --> From Data Model --> You can either choose New Worksheet or Existing Worksheet , which ever suits you best, for this example i have selected existing worksheet cell A9

However you can also right click on the QUERIES & CONNECTIONS and click load to Pivot Table Report and Press Ok.

插入选项卡数据透视表

数据模型的数据透视表

查询和连接

数据透视表报告

12.) So you see the Pivot Table layout has been created and you can also find the Pivot Table Fields Panel on the right side of your worksheet, From Fields panel you will find all the tables has been listed, select the Grupo Table --> Drag the Grupo Field in the Rows Areas while the Razon will be in the Values area respectively, you can change the layout design from design table, as well as from Report Layout change it to Show in Tabular Form.

输出

最后但并非最不重要的

13.) In this manner you can Transform your data to Summarize a Pivot Table !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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