One of the most indicative charts for Salesforce data is the funnel chart, which is the chart in which we can follow the progression of our sales pipeline from initial contact to final conclusion.
For this chart, we will use the custom dataset Opportunity History that comes with this book. If you are working with real Salesforce data, you should be able to replicate this chart using the Opportunity History object from your Salesforce environment or your data warehouse, following the instructions in Chapter 3 – Building and Integrating Data Pipelines.
To create a funnel chart, follow these steps:
- Filter out “Closed Lost” by using Stage Name as a filter and excluding “Closed Lost”.
- Drag Stage Name onto Rows, as shown in the following figure:
Figure 6.24: Drag Stage Name to Rows
- Right-click on Opportunity ID and drag it to Columns. In the menu that opens, choose Count Distinct (Figure 6.25).
Figure 6.25: Count distinct Opportunities by Stage
- Sort Stage Names in descending order according to the number of opportunities.
Figure 6.26: Sort Stages by count descending
We now need to trick Tableau into creating our funnel chart. To do so:
- Right-click on Opportunity ID, drag it to Columns, and drop it next to the green pill you already have there, as shown in Figure 6.27:
Figure 6.27: Copy Opportunity Id to Columns
You should now have two identical bar charts which look like the chart below:
Figure 6.28: Two identical bar charts
- Right-click on the left axis and click Edit Axis from the menu that opens, as shown below:
Figure 6.29: Copy Opportunity Id to Columns
- Select Reversed, as shown in Figure 6.30:
Figure 6.30: Reverse left axis
Your chart should now look like the one below, already much more like a funnel.
Figure 6.31: Funnel
- Drag Stage Name to the Color mark in the All card, as shown in Figure 6.32:
Figure 6.32: Color Stages
- Press Ctrl on your keyboard and drag the CNTD (Opportunity ID) field to the Label mark in the All card, as shown in Figure 6.33:
Figure 6.33: Add label
- Click on the Label mark on the top CNTD (Opportunity ID) card, as shown in Figure 6.34:
Figure 6.34: Select label
- In the Alignment menu, choose left, as shown in Figure 6.35:
Figure 6.35: Align labels left
A funnel would not be a proper funnel without percentages, so we will create a new calculated field and paste the following formula:
This formula divides the number of opportunities at each stage by the number of opportunities in the first stage, thus giving us a view of the percentage of opportunities that continue to the next stage of our sales pipeline.
- Give your calculated field a name. The one below, for example, is called “Share of total”.
Figure 6.36: Share of total calculation
- Drag your new calculation onto the Label mark in the bottom CNTD (Opportunity ID) card, as can be seen in Figure 6.37:
Figure 6.37: Add calculation to label
- Drag CNTD (Opportunity ID) away to remove it from the chart, as can be seen in Figure 6.38:
Figure 6.38: Remove count
- Click on the Label mark on the bottom CNTD (Opportunity ID) mark, as shown in Figure 6.39:
Figure 6.39: Select bottom label
- In the Alignment menu, choose left, as shown in Figure 6.40:
Figure 6.40: Align bottom labels left
- Right click on the calculation you have created and select Default Properties from the menu that opens, next click on Number Format.
Figure 6.41: Open number formatting
- In the pane that opens, select percentage, decrease the decimal places to 0, and click on OK, as shown in Figure 6.42:
Figure 6.42: Set percentage format
We are almost there, but we need some cosmetic adjustments for this chart to look like a funnel, follow the below steps to do so:
- From the Format menu, click on Borders, as can be seen in Figure 6.43:
Figure 6.43: Open Borders menu
- Select None from each menu in Sheet, Rows and Columns (if it does not say so already), as can be seen in Figure 6.44:
Figure 6.44: Select no borders
- Click on the Lines icon (Figure 6.45).
Figure 6.45: Open Lines menu
- Select None from each menu in Sheet, Rows and Columns (if it does not say so already), as shown in the figure below:
Figure 6.46: Select no lines
- Right click on the left axis and untick “Show Header”, as shown in Figure 6.47:
Figure 6.47: Hide left axis header
Your chart should look something like the one below:
Figure 6.48: Funnel final