Sub topic 13
Sorting, labels, axes and color
This chapter assumes you can build a basic visual on the Power BI Desktop canvas and that your model has a marked date table. It covers four formatting choices that decide whether a correct visual is also easy to read.
Sort so the order carries meaning
Power BI sorts a category axis alphabetically by default. That order rarely answers a question. Use the visual's More options (...) menu, then Sort axis, and pick the field and direction.
- Ranking or comparison: sort by the measure, descending. The largest bar goes first.
- Time: sort by date, ascending.
- Ordered categories such as months or size bands: sort by a numeric key column, not by the label.
The last case is a common error. A month name column sorts as April, August, December. In the Data view, select the month name column, then use Sort by column on the ribbon and choose the month number. The same fix applies to the Price Band column from the earlier DAX example, which would otherwise show "200 and over" before "50 to 199".
Month Sort = MONTH ( 'Date'[Date] )Label what the reader needs
Data labels remove the need to read values off an axis. They work well on a few bars and become noise on a dense line chart.
- Turn on data labels for bar and column charts with fewer than about 15 categories.
- On line charts, label only the last point or a few key points.
- Set Display units (thousands, millions) so labels read "4.2M" and not "4,218,377".
- Remove labels that repeat what the axis already shows.
Choose axes that do not distort
The value axis of a bar or column chart should start at zero. Bar length encodes the value, so a truncated axis exaggerates differences. A line chart encodes values by position, so a non-zero start is acceptable when the changes would otherwise be flat, but say so in the axis title.
Also check three settings:
- On a date axis, set the type to Continuous for true time spacing, or Categorical to show each period equally spaced.
- Turn off the axis title if the visual title already says the same thing.
- Use a logarithmic scale only for audiences who know how to read one.
Use color with a purpose
Color should encode something. A rainbow of unrelated colors adds nothing.
- Use one color for a single-series chart.
- Use a gray base and one accent color to highlight the bar or line you are talking about.
- Use a sequential scale (light to dark) for ordered values, and distinct hues only for unordered categories.
- Use red and green with care. About 8% of men have red-green color vision deficiency, so pair color with labels, icons or position.
To color by value, open the color control and choose fx (conditional formatting), then base it on a field such as Sales YoY %.
Exercise
A column chart shows Total Sales by month. The columns appear in the order Apr, Aug, Dec, Feb. What is the fix, and where do you apply it?
Show answer
Create or use a numeric month number column (for example MONTH('Date'[Date])), select the month name column in the Data view, and use Sort by column to sort it by the month number. Then make sure the chart's axis is sorted by that column in ascending order.