
Explanation:
Step 1: Select the [Department] and [Stage] columns and unpivot the other columns.
We unpivot the School1, School2, School3, and the School4 columns.
You might want to unpivot data, sometimes called flattening the data, to put it in a matrix format so that all similar values are in one column.
When you unpivot, you unpack the attribute-value pairs that represent an intersection point of the new columns and re-orient them into flattened columns:
* Values (in blue on the left) are unpivoted into a new column (in blue on the right).
* Attributes (in green on the left) are unpivoted into a new column (in green on the right) and duplicates are correspondingly mapped to the new Values column.
Step 2: Rename the [Attribute] column as [School] and the [Value] column as [Score] Step 3: Group by [Department] and [School] and.
Reference:
https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-
9d95-f588221c7098