← All challenges

M3 · Modeling · about 10 min

Months in Order

easy

The runs-by-month chart lists April, August, July, June, May, September. Someone sorted that one chart by its axis and saved it, but every new chart starts alphabetical again, and the month slicer is alphabetical too.

Your task

Fix the model so that Games[MonthName] sorts in calendar order in every visual, without sorting each visual by hand.

What the grader checks

You see the situations, not the expected numbers. The expected values are computed live from your file and the source data.

  • C1MonthName sorts by the month number
    Games[MonthName] has Sort by column set to a month number column (Games[MonthNo] or Games[Month]).

Stuck?

Open one hint at a time.

Hint 1

Sorting a visual only changes that visual. Is there a setting on the column itself that every visual follows?

Hint 2

A text column sorts alphabetically unless it is told to sort by another column. Games already has a month number next to the month name.

Hint 3 (near-answer)

Select Games[MonthName], then Column tools > Sort by column > MonthNo.

Show the editorial

Solve it first if you can: the editorial gives the answer away.

The trap

A month name is text, and text sorts alphabetically: April, August, July. Sorting a chart by its axis fixes that one chart and nothing else, so every new visual, slicer and table starts alphabetical again.

The fix

Select Games[MonthName] and set Sort by column to Games[MonthNo].

Why it works

Sort by column is stored on the column in the model. Every visual that shows MonthName now orders it by the month number behind it, including visuals that do not show the number. It only works because each month name has exactly one month number.

Fix the order of a label once, on the column (Sort by column), not in each visual.