To make a butterfly chart in Tableau, you must create a diverging bar chart by using a calculated field to negate one of your two comparison metrics, effectively pushing its bars to the left of a central axis. This technique allows you to compare two different categories—such as male vs. female demographics or last year vs. this year's sales—side-by-side on a single axis. Because Tableau does not have a native 'Butterfly Chart' button, you achieve this effect through manual manipulation of your measures and axis formatting.

What You'll Need

  • Tableau Desktop or Tableau Public installed on your computer.
  • A dataset containing at least one dimension (the categories you want to compare) and two distinct measures (the values you are comparing).
  • A basic understanding of how to create calculated fields and manipulate axes in Tableau.

Step-by-Step

  1. Connect to Your Data: Open Tableau and connect to your data source. Ensure your data is structured so that your categories (e.g., 'Product Category' or 'Region') are in one column and your two metrics (e.g., '2023 Sales' and '2024 Sales') are in separate columns or can be easily pivoted.
  2. Set Up the Primary Dimension: Drag the dimension you want to use as your rows (the labels for your bars) onto the Rows shelf. For example, if you are comparing demographics, drag 'Gender' or 'Age Group' to Rows.
  3. Create the Negative Measure: This is the most critical step. Since a butterfly chart requires bars to grow in opposite directions from a center line, one set of values must be negative. Right-click in the Data pane and select 'Create Calculated Field'. Name this field something like 'Negative [Measure Name]'. For example, if you are comparing 'Current Year Sales', your formula would be `-[Current Year Sales]`. Click OK.
  4. Build the Initial View: Drag your original, positive measure onto the Columns shelf. Then, drag your newly created negative calculated field onto the Columns shelf, placing it to the left of the first measure. You should now see two sets of bars, but they will likely be side-by-side on the same side of the zero line or overlapping incorrectly.
  5. Align the Bars: To get the 'butterfly' look, ensure your dimension is on Rows and both measures are on Columns. If you see a single axis, you may need to change the Mark type. On the Marks card, change the dropdown from 'Automatic' to 'Bar'.
  6. Fix the Axis Labels: By default, the left side of your chart will show negative numbers (e.g., -50, -100). To make this look professional, you need to format the axis to show absolute values. Right-click the bottom axis (the one with the negative numbers) and select 'Format'. In the Format pane on the left, go to the 'Scale' section and click on 'Numbers'. Select 'Number (Custom)'. In the 'Number Format' settings, look for a way to display absolute values. If your version of Tableau does not allow a direct 'Absolute Value' format, you can use a Custom format string: `#,##0;#,##0`. The part after the semicolon tells Tableau how to display negative numbers; by omitting the minus sign in that second part, the negative numbers will appear positive on the axis.
  7. Add a Central Divider: To clearly define the center, you can add a reference line. Right-click on the X-axis (the zero line) and select 'Add Reference Line'. Set the scope to 'Entire Table', set the value to 'Constant', and enter '0'. Set the line to be a solid, thin black or gray line to act as the spine of your butterfly.
  8. Refine the Visuals: To distinguish the two sides, drag one of your measures onto the 'Color' property on the Marks card. You can then click 'Edit Colors' to choose two contrasting colors—one for the left side and one for the right. Ensure the colors are distinct enough for accessibility.
  9. Adjust Bar Width and Spacing: If the bars look too thin or too crowded, click on the 'Size' property in the Marks card and adjust the slider. You can also adjust the row height by dragging the boundaries between rows in the view to ensure the labels are legible.

Common Mistakes

One of the most frequent mistakes is failing to use a calculated field to negate the values. Many users try to use the 'Dual Axis' feature to create a butterfly chart. While Dual Axis is excellent for overlaying two different types of charts (like a line and a bar), it is not designed to flip a bar chart across a central zero axis. If you use Dual Axis, you will end up with two separate axes that may not align perfectly, making direct comparison difficult.

Another mistake is neglecting the axis formatting. If you leave the negative signs on the left side of the chart, it can confuse the viewer, making it look like a loss or a deficit rather than a comparative metric. Always use the custom number formatting trick to hide the negative signs.

Finally, users often forget to check the scale. If one measure has a much larger range than the other (for example, comparing 'Revenue' in millions to 'Customer Count' in hundreds), the butterfly chart will look lopsided and unreadable. In such cases, you may need to normalize your data or use two separate charts with synchronized axes, though a true butterfly chart works best when the two measures are on a similar scale.

Tips

To make your butterfly chart even more effective, consider adding labels. Drag your original measures onto the 'Label' property in the Marks card. For the negative side, you may need to create another calculated field that uses the `ABS()` function (e.g., `ABS([Negative Measure])`) to ensure the labels themselves show up as positive numbers on the bars.

Color theory is vital here. Avoid using red and green if your chart is intended for a general audience, as this can be problematic for colorblind viewers. Instead, use blue and orange or two shades of the same color family to represent the two sides of the comparison. This maintains clarity while being more inclusive.

If you are comparing many categories, the butterfly chart can become cluttered. In these instances, consider sorting your dimension by the sum of the absolute values of both measures. This creates a 'descending' effect from the center, which helps the eye follow the most significant data points first.

Troubleshooting

If your bars are not appearing on both sides of the zero line, double-check your calculated field. Ensure you have actually included the minus sign (`-`) before the field name. If the bars are overlapping each other on the same side, you likely have both measures on the same axis or have accidentally used a Dual Axis without negating one of the measures.

If the axis labels are still showing negative signs despite your formatting efforts, ensure you applied the format to the specific axis and not just the field in the data pane. Sometimes, Tableau applies formatting to the field globally, but the axis itself requires a specific 'Custom' number format to override the display.

If the chart looks 'squashed' or the bars are extremely thin, check your Rows shelf. If you have too many dimensions on the Rows shelf, Tableau will attempt to fit everything into the available vertical space. Try removing unnecessary dimensions or increasing the height of your dashboard/worksheet.

Frequently Asked Questions

Can I use a butterfly chart for three categories?

A standard butterfly chart is designed for two-way comparisons. If you have three categories, you would typically use a grouped bar chart or a stacked bar chart instead. A butterfly chart relies on a central axis to split the view in two.

Do I need to pivot my data to make this work?

Not necessarily. While pivoting data (turning columns into rows) is a common Tableau practice, for a butterfly chart, it is actually easier to keep your two measures in separate columns so you can easily negate one of them via a calculated field.

How do I handle zero values in a butterfly chart?

Zero values will simply not show a bar. This is visually accurate. However, if you want to show that a value is zero rather than just 'missing,' you can add a small constant to your calculation or use a shape mark to indicate a zero point.

Is a butterfly chart better than a side-by-side bar chart?

It depends on the goal. Side-by-side bars are better for seeing the exact difference in magnitude between two items. Butterfly charts are better for visual symmetry and comparing the 'shape' of two different distributions across many categories.

Can I create a butterfly chart on Tableau Mobile?

You can view butterfly charts on Tableau Mobile, but creating them requires the full Tableau Desktop or Tableau Web Authoring interface. The mobile app is primarily for consumption and interaction, not for complex chart construction.

What if my measures have different units?

If you are comparing, for example, 'Weight' and 'Height', a butterfly chart will be misleading because the scales are different. You should normalize the data (convert both to a percentage of a maximum or a z-score) before building the chart.