Advanced Excel · Intermediate level

Intermediate level · Module 1: Power Query for Data Preparation · Lesson 2 of 3

Reshaping and Combining Data

Unpivot wide tables, append monthly files and merge related tables.

In this lesson you will

  • Unpivot cross-tab data into a tidy table
  • Append and merge queries

Key concepts

unpivotappendmerge (join)join kinds

The lesson

Many reports arrive wide, with one column per month. Unpivot turns them into a tidy table with month and value columns, ready for PivotTables and models.

Append stacks tables with the same columns, such as monthly files. Merge joins tables on a key, like a lookup — for example adding the branch region from a branch table.

Choose the join kind deliberately: left outer keeps every row of the first table; inner keeps only matches. Check row counts after merging.

Step by step

  1. Unpivot a wide budget table.
  2. Append two monthly tables.
  3. Merge the branch table to add regions.
  4. Check row counts before and after.

Practice activity

Reshape and combine the practical activity's monthly data with the branch table.

Expected result: A tidy combined table with correct row counts.

Check your understanding

  1. What does unpivoting do?

    Show answer

    Turns columns such as months into rows of a single column.

  2. What is the difference between append and merge?

    Show answer

    Append stacks rows; merge joins tables on a key.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.