PowerQuery in Excel Example

Creation date: 5/20/2026 1:05 PM    Updated: 5/20/2026 1:05 PM   excel powerquery

Problem: I have about 400 rows of data in an Excel spreadsheet. How can I group it so that id, fullname, admit_yr, deg_grant_yr, and current_major appear as rows, sessyr appears as columns, and the value shown is session_major?

Example data:

id,fullname,sessyr,admit_yr,deg_grant_yr,current_major,session_major
220926,Student1,FA2023,2020,2024,OTBS,OTBS

Solution: Power Query

This is the cleanest way to pivot your session majors into columns without aggregation issues:

  1. Select your data range → Data tab → From Table/Range
  2. In Power Query Editor, select the sessyr column
  3. Go to Transform tab → Pivot Column
  4. Set "Values Column" to session_major
  5. Click Advanced options → select Don't Aggregate
  6. File → Close & Load to return to a new sheet

This will give you columns like FA2023SP2024, etc., with the actual major text displayed.

Addtional documentation (written by BooodleBox) included