How to show before and after in one chart

Some data questions only need two moments: where did each item start, and where did it end? Three charts for before and after, when to use each, and the DAX for the two values.

Short answer: when only the start and the end matter, show those two values per item and the change between them. A dumbbell (two dots joined by a line) shows both values and the gap; a slope chart (two columns of dots joined by lines) shows who rose and who fell; a sorted bar of the change shows only the difference, biggest first. A line chart of every month in between is the wrong tool when the months in between are noise.

Many business questions only care about two moments: last year against this year, before against after a change. For that question everything in between is noise, and a chart that shows every month hides the answer.

What does a before and after look like?

  • Before
  • After
020406080100EmailChatPhoneApp
Customer satisfaction before and after the new support hours (made-up, score out of 100)

Chat improved most, and phone is the one channel that slipped. The months in between would only have hidden that.

Which of the three charts fits?

ChartShowsBest when
DumbbellBoth values and the gap, per itemYou want the level and the change
Slope chartRises and falls as line directionsMany items, and the direction matters most
Bar of the changeOnly the difference, sortedOnly the change matters, e.g. "+14 points"

How do you get the two values in DAX?

Score Before = CALCULATE ( [Avg Score], 'Period'[Phase] = "Before" )
Score After = CALCULATE ( [Avg Score], 'Period'[Phase] = "After" )
Score Change = [Score After] - [Score Before]

A Phase column in a small period table keeps the dates of the change in one place; change the cut-off once and every measure follows.

What goes wrong?

  • Different lengths. Three months before against one month after is not a fair comparison.
  • Hidden seasonality. December against June mixes the change with the season; compare like with like.
  • Cause. Before and after shows that something changed, not that your change caused it.

Where can you check this?

Where do you start?

For change against last year with a date table, see year-over-year in DAX. To see which chart fits your own before and after data, paste it into Chart Compass.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.