Friday, October 26, 2012

Sorting Pivot Table by Last Column in Row Field (Row Label)


In a Pivot Table, if there are 5 or more than 5 columns as Row fields (Row label) and if we want to sort entire pivot table by values available in column 5 then it is not possible to sort Column 5 values only using Sort options (Except manually dragging rows in a pivot table) as data is grouped based on previous columns and it will be sorted within groups of previous columns. Sorting in Pivot is based on primary(First) column and then subsequent columns.

there is a workaround as below; 

In your source data, Add a new column with same values with column that you want to sort at position 5; refresh current pivot or create a new pivot; create pivot layout as per your requirement; Place newly created column as first column ; do sorting on first column and hide first column of pivot table ; if you have "Report Filters" then report filter headings will also become invisible due to hiding column hence write "report filter " headings in the cells next to the "Report filter" selection drop downs" or Else instead of hiding column just format the first row field in  such a way that one can not see any values there (like applying sheet colour to fonts)

1 comment: