Back to Blog

Power BI Sort by Column - Why Your Months Look Wrong and How to Fix Them

May 18, 20268 min readMichael Ridland

Every Power BI consultant has had this conversation. You build a sales report, add a Month column to a bar chart, hit refresh, and the bars come back as April, August, December, February, January. The user looks at it, decides Power BI is broken, and starts asking whether Excel would have been the safer choice.

It is not broken. Power BI is doing exactly what you asked it to do, which is sort the column alphabetically. The fix is small, takes about thirty seconds, and is one of the first things we teach Australian teams when we onboard them onto the platform through our Power BI consulting work. This post walks through how to do it properly, in both Power BI Desktop and the Power BI service, and the handful of edge cases that cause grief once you scale beyond a single report.

Why this happens in the first place

Power BI sorts text columns alphabetically by default. That is a sensible choice for most string data. Customer names, product categories, suppliers, country codes - alphabetical is the right answer. But for any text column that represents an ordered sequence, alphabetical sorting is exactly the wrong answer.

The classic culprits we see in Australian datasets:

  • Month names (January, February, March...)
  • Day-of-week names (Monday, Tuesday, Wednesday...)
  • Financial quarters where Q1 starts in July, not January
  • Customer satisfaction ratings like Poor, Fair, Good, Excellent
  • Status fields like Draft, In Review, Approved, Published
  • T-shirt sizes (XS, S, M, L, XL, XXL)

Each of these has a natural order that is not alphabetical. The pattern we teach to fix all of them is the same.

The pattern - sort by column

The idea is straightforward. You need two columns at the same grain. One is the column you actually want to display, like the month name. The other is a hidden numeric column that defines the correct sort order, like the month number. You then tell Power BI to sort the display column by the order column.

For months, your model needs:

  • A MonthName column with values like "January", "February"
  • A MonthNumber column with values like 1, 2

If you do not already have a date table with these columns, build one. The DAX CALENDAR and CALENDARAUTO functions make this trivial, and a proper date table is one of the highest-impact things you can add to any Power BI model. We have written before about why date tables matter, and this is one of the reasons.

Doing it in Power BI Desktop

The steps in Desktop are short, but you have to be in the right view for the option to appear, which is the first thing that trips people up.

  1. Switch to Report view if you are not already there. The Sort by Column button only appears on the Column tools ribbon when you are in Report view, not Model or Table view. This is a recent enough change that older online tutorials still show it living somewhere else.
  2. In the Data pane, click on the MonthName column to select it.
  3. The Column tools tab will appear in the ribbon. Click Sort by column, then pick MonthNumber from the dropdown.
  4. Go back to your visual. The months are now in calendar order across every visual in the report that uses this column.

That last point is worth dwelling on. The sort setting is a property of the column in your data model, not a property of any individual visual. Set it once, and every chart, table, slicer, and matrix that uses MonthName will sort correctly. This is the right behaviour but it is also why mistakes here are hard to spot. If you set up the sort wrong, every report you build on top of that model inherits the problem.

Doing it in the Power BI service

The browser version of Power BI has a different approach because you do not have access to model-level settings on a published report. Instead, you sort at the visual level by adding the order column to the visual's Tooltip bucket and then sorting by it.

  1. Open the report in the Power BI service, click Edit, and select the visual you want to sort.
  2. In the Fields pane, find your MonthNumber field.
  3. In the Visualizations pane, drag MonthNumber into the Tooltip bucket. This makes the field available to the visual without changing what gets displayed on the axis.
  4. Click the More options dots in the visual, choose Sort axis, then pick MonthNumber.

One thing to know: by adding MonthNumber to the Tooltip bucket, it will now appear when users hover over the bars. If that bothers you, build a custom tooltip page that does not include the number. Custom tooltips are a feature that genuinely improves report quality once your team learns them.

The service approach is fine for one-off fixes, but if you are doing this for more than a handful of visuals, do it in Desktop and republish. Setting it model-wide is always less work than doing it visual by visual.

The granularity rule that trips everyone up

Both columns have to be at the same level of granularity. Power BI enforces this strictly and the error message is not always clear when it goes wrong.

What this means practically: if you have a MonthName column and try to sort it by a Date column, Power BI will refuse. The Date column has 30 or 31 distinct values for each month name, so the sort order is ambiguous. Does "January" come before "February" because January 1 is before February 1, or because January 15 is before February 15? Power BI cannot pick.

The order column needs exactly one distinct value per distinct value in the display column. One month name, one month number. One day name, one day number. One quarter name, one quarter number. This sounds obvious but it is the single most common cause of confused support tickets when teams first try this.

If you find yourself stuck, check whether your sort column is varying inside groups of your display column. If it is, you need to add a calculated column that picks one value per group, usually with MIN or MAX.

The key column trap

One footnote that has bitten us on real client work. If you mark a column as a key column in your model (sometimes happens automatically when you set up relationships, sometimes manually), Power BI ignores any Sort by Column setting on it. The sort reverts to the default alphabetical order.

If you have set up Sort by Column correctly and a column is still sorting alphabetically, check the column properties in the Model view. If "Is key" is on, that is your problem. Either turn it off, or apply the sort to a different non-key version of the column.

Where this fits in a real report build

Sort by Column is one of those small features that separates reports that feel professional from reports that feel like a draft. We see it skipped or done badly more often than almost any other model-level setting, usually because the person building the report is focused on getting numbers right and the visual polish comes later. Then later never arrives, the report ships, and the first user comment is about the month ordering.

For any Power BI project we deliver, we set up sort orders on every text column that has a natural sequence during the model build, not at the end. Doing it once at the model level means every report built on top inherits the right behaviour. Skipping it means every report builder has to remember to fix it themselves, and they will not, every time.

If your team is rolling out Power BI across a few hundred users and you want to make sure these foundational things are right from the start, this is the kind of thing our Microsoft Fabric consulting work covers. The pattern of build-the-model-once and reuse it everywhere is what makes Power BI shine at scale, and it falls apart fast when the model layer has gaps.

Quick reference

For the most common cases, this is the cheat sheet I keep in the back of my head when reviewing client models:

  • Calendar months: MonthName sorted by MonthNumber (1-12)
  • Australian financial year months: FYMonthName sorted by FYMonthNumber where July = 1
  • Day of week: DayName sorted by DayNumber (Monday = 1 in ISO, or Sunday = 1 in US convention - pick one and document it)
  • Quarters: Quarter like "Q1", "Q2" sorted by QuarterNumber (1-4)
  • Custom buckets like age ranges or revenue tiers: text bucket column sorted by numeric bucket order

That covers about 95% of the cases. The rest are bespoke ordering rules that come up in specific industries - common ones we see include risk grades in financial services, severity codes in healthcare, and inspection statuses in mining.

One more honest opinion

The Sort by Column feature has been in Power BI since the early days, and Microsoft has resisted the temptation to add fancier alternatives. There are no per-visual override toggles, no expression-based sort orders, no automatic detection of "ordinal-looking" text columns. That is the right call. Keeping the feature minimal means it is predictable, and predictable is what you want from your data model layer.

The Microsoft documentation for Sort one column by another in Power BI is the canonical reference and worth bookmarking. The page is short because the feature is small. That is a good thing.

If you are running into specific Power BI issues that go beyond the basics, or you want a second pair of eyes on a model that is starting to feel unwieldy, get in touch. We do a lot of these reviews and most of them come down to a handful of patterns being applied or not applied across the model. Sort by Column is one of them.