Practical technology learning

Power Query Unpivot: Give Monthly Values One Consistent Row Shape

Power Query Unpivot: Give Monthly Values One Consistent Row Shape — conceptual learning illustration
AI-generated conceptual illustration.

A useful analytical table often needs a repeatable row meaning. This exercise turns a small wide monthly table into branch-month observations. All branch names and quantities below are fictional practice data, not Mango Engineers operational results.

Start with four populated measurement cells

Create Branch, Jan and Feb columns. North has 10 units in January and 12 in February; South has 8 and 9. The four measurements total 39. There is one input row per branch, and the month is currently encoded in each measurement column heading.

Reshape without losing the identifier

In a disposable Power Query exercise, keep Branch and unpivot Jan and Feb. Rename Attribute to Month and Value to Units. The expected four output rows each carry a branch, a month label and a quantity. Check that North-January still has 10 and South-February still has 9 before loading anything.

Write the new row meaning

One row now represents one branch-month observation. Set an appropriate numeric type for Units and retain a year or unambiguous period key when extending the dataset. A text label such as Jan cannot distinguish January in different years. Reshaping does not, by itself, establish a reliable date model or remove duplicate source records.

Rehearse a changing source schema

Compare a transform that targets the two named month columns with Unpivot Other Columns after selecting the identifier fields. The latter can accommodate a new month column on refresh. It can also include an unexpected Notes or Target field. Review the source schema and the transformed preview when new columns arrive instead of assuming every added field is another monthly quantity.

Reconcile before reporting

  • For this all-populated example, expect four output observations.
  • Check the same total of 39 before and after reshaping.
  • Test zero separately from null; do not infer missing observations from a neat grid.
  • Document retained identifiers and the meaning of each attribute label.

Keep the learning boundary clear

Power Query transformation is within the existing Mango Engineers Power BI course scope. The exercise prepares a clearer input for later modelling; it does not establish correct relationships or a finished dashboard. Use current Microsoft documentation for the transform and review its null behavior when adapting the example.

Primary references

Browse more practical learning articles