Power Query Problems

Reshape Untidy Excel Data into Separate Pell and Non-Pell Columns in WPS Office

Elise WilliamsElise Williams Nov 13, 2026 870 views

Question details

The user needs to transform row-based Pell and non-Pell performance data into a crosstab with one row per course and term and separate metric columns.

Reshape Untidy Excel Data into Separate Pell and Non-Pell Columns in WPS Office
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
A user is analyzing institutional data where course, term, Pell status, and performance measures such as WU, DFW, total students, and DFW percentage are stored in rows and needs a side-by-side Pell and non-Pell summary.
Observed behavior
The current source layout repeats course and term rows for each status and measure, making comparison across Pell and non-Pell categories difficult.
Before you start

Before you start, check that the Pell status values are spelled consistently, such as Pell and non-Pell, and decide whether you need a refreshable Power Query result or a quick PivotTable summary.

Solution 1Recommended

Use Power Query to Pivot a Combined Status_Metric Column

Best when you want a clean, refreshable source table with one row per course and term and separate Pell and non-Pell metric columns.

This method imports the untidy source into Power Query, standardizes the status values, and pivots a combined Status_Metric column. If the source stores one row per metric, use Don't Aggregate; if it stores detail rows, aggregate counts with Sum and recreate the DFW percentage after loading.

1
Open Power Query from the source table

In WPS Office Spreadsheets, click any cell inside the source table, open the Data tab, and select From Table/Range to load the range into Power Query.

2
Standardize Pell and non-Pell values

In Power Query, select the status column, click Transform > Replace Values, and replace any inconsistent labels so only Pell and non-Pell remain.

3
Create a Status_Metric column

Click Add Column > Custom Column, name it Status_Metric, and enter a formula similar to [Status] & "_" & [Metric].

4
Pivot the combined column

Select the Status_Metric column, click Transform > Pivot Column, set the Values Column to the numeric measure column, and choose Don't Aggregate if each Course-Term-Status-Metric row appears once, or Sum for counts and totals.

5
Load the reshaped data

Click Close & Load and choose a new worksheet to return a table with Course and Term as row identifiers and Pell_WU, Non-Pell_WU, Pell_DFW, Non-Pell_DFW, and related total and percentage columns.

Use Power Query to Pivot a Combined Status_Metric Column
Output is ready: You should now see one row per course and term with Pell and non-Pell metrics in separate columns.
WPS Office Spreadsheets

Reshape Pell and Non-Pell Data in WPS Office Power Query

In WPS Office Spreadsheets, open Power Query from the Data tab, create a Status_Metric column from the Pell/non-Pell status and metric fields, then pivot it into separate WU, DFW, total student, and DFW percentage columns for each course and term. Once the query is built, you can refresh it whenever the source data updates.

  1. 1. Open Power Query: In WPS Office Spreadsheets, click any cell in the source table, then go to Data > From Table/Range.
  2. 2. Standardize status values: Replace inconsistent Pell and non-Pell labels in the status column so the pivot produces clean column headers.
  3. 3. Create and pivot Status_Metric: Add a custom column named Status_Metric that combines the status and metric fields, then use Transform > Pivot Column with the numeric measure column.
  4. 4. Load the reshaped table: Click Close & Load, and then refresh the query from Data > Refresh All whenever the source rows change.
Converts row-based Pell and non-Pell records into side-by-side columns without manual copy-paste.Uses familiar Power Query steps that you can refresh when source data changes.Keeps full compatibility with Microsoft Excel .xlsx files, so you can open and share reshaped workbooks with colleagues.Simplifies DFW percentage, WU, and total student comparisons by Course and Term.
microsoft office alternative - wps office

Frequently Asked Questions

Can I do this without Power Query in WPS Office?

Yes, you can use Insert > PivotTable and place Course and Term in Rows, Pell status and Metric in Columns, and the numeric measure in Values. However, this creates a report view rather than a transformed source table.

Why should I create a combined Status_Metric column before pivoting?

Power Query pivots one attribute column into new column headers. Combining Status and Metric makes column names such as Pell_WU and Non-Pell_DFW so each measure has its own field.

What aggregation should I choose when pivoting WU, DFW, total students, and DFW percentage?

If the source has one row per metric, choose Don't Aggregate. If there can be multiple detail records, use Sum for counts and totals, and recalculate the DFW percentage after loading instead of aggregating percentages.

Will this reshaped table update when the source data changes?

Yes, if you use Power Query, click Data > Refresh All or refresh the query to pull updated rows and reapply the pivot transformation.

Can WPS Office open this reshaped workbook in Microsoft Excel?

Yes, save the output as an .xlsx file and it remains fully compatible with Microsoft Excel for opening, sharing, and further editing.