Sub topic 17
A repeatable process for choosing a visual
This chapter assumes you have read the earlier chapters. You should know the four field types (categorical, numeric, date/time, geographic), how measures feed the field wells, and the main built-in visuals. Here you combine them into one process you can run every time you add a visual to a report page.
The five-step process
- Write the question as a sentence. Example: "Which product categories drive the most sales this year?"
- Name the analytical task. The example is a ranking. Other tasks are comparison, trend, composition, distribution, relationship, single value, or location.
- List the fields and their types. Ranking needs one categorical field (
Product[Category]) and one numeric measure ([Total Sales]). - Pick the visual and write the measures. Use the lookup table below, then create any measure the visual needs.
- Check, format and test. Look for pitfalls, sort and label the visual, then confirm that cross-filtering and accessibility work.
Step 4: map the task to a visual
Question -> Typical visual
Compare categories -> Clustered bar or column chart
Rank categories -> Bar chart sorted by value
Change over time -> Line chart
Parts of a whole (few parts) -> Stacked bar, donut or treemap
Bridge from start to end value -> Waterfall chart
Relationship between 2 measures -> Scatter chart
One headline number -> Card or KPI
Exact values, many fields -> Table or matrix
Values by location -> Map or filled mapTreat this as a starting point. Field types can override it. A date field on the axis points to a line chart, and a geographic field points to a map. A category with 40 values is a poor fit for a donut chart, whatever the task says.
Worked example
The question is: "Is revenue growing, and by how much compared with last year?"
- Task: trend, plus a single headline number.
- Fields:
'Date'[Date](date) and sales (numeric). - Visuals: a line chart for the trend and a card for the change.
The measures:
Total Sales = SUM ( Sales[SalesAmount] )Sales LY =
CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )Sales YoY % =
DIVIDE ( [Total Sales] - [Sales LY], [Sales LY] )Put [Total Sales] and [Sales LY] in the line chart's Y-axis well, with the date hierarchy on the X-axis. Put [Sales YoY %] in a card. SAMEPERIODLASTYEAR needs a marked date table, so check that first. DIVIDE returns blank instead of an error when last year's value is zero or blank.
Step 5: the final check
Ask these questions before you move on:
- Does the visual answer the sentence from step 1 without explanation?
- Is the sort order meaningful, such as by value for rankings and by date for trends?
- Do the axis, labels and colors avoid misleading the reader?
- Does clicking one visual filter the others in a useful way?
- Can someone read it without relying on color alone?
Exercise
A manager asks, "How does each region's share of total sales compare, and which region is largest?" Walk through steps 1 to 4. Name the task, the field types, one suitable visual, and the measure that supplies the values.
Show answer
The task is composition combined with ranking. The fields are one categorical field (region) and one numeric measure (sales). A bar chart sorted by value works well if there are many regions. A treemap or stacked bar also works if there are only a few. The measure is a share of total, such as Sales % of Total = DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALL ( Product[Category] ) ) ), with the ALL argument changed to the region column (for example ALL ( Geography[Region] )).