The Depivot function is a very powerful function that allows you to take your data and stack columns into two columns (one column containing the Column headers that the original data came from, a second column containing the value from that column). While a very powerful feature, for users who have never used a function like Depivot, it can be tough to understand exactly what is happening during the Depivot process.
In the Depivot window, you will be given multiple options to choose/designate.
Row Labels: Here, you select which columns you want to remain static in your data and not be "stacked" during the Depivot process.
Values: This option allows you to choose which columns from your data will be included (or "stacked") during the Depivot process.
Column Label: Allows you to designate a column name for the new column containing the Column Labels from the columns selected in the "Values" field.
Value Label: Allows you to designate a column name for the new column containing the values from the columns selected in the "Values" field.
In the example above, the preview displays how the Depivot function takes the selected columns from the "Values" field and "stacks" them into the two new columns. For an easier way to visualize exactly what is happening, view the images below. The columns have been color coded to make it more easily noticeable where specific values are coming from and moving to during the Depivot process.
In this example, the "LOCATION" column has been selected as the only value for the "Row Label". Due to the "stacking" of the column values during the Depivot process, you will notice that there are now duplicate rows for each location. This is to allow each value from the columns selected in the "Values" field to have its own row. You can see that by using the Depivot function, all of the sales numbers are in a single column. In this format, Group By functions can be very useful and provide insight into your data that may otherwise go unnoticed.
Other shaping operations:
Shape (Group By)