Add Reference Distributions in Tableau

In this article, we will show you how to add Reference Distributions in Tableau with examples.

For this Tableau Reference distribution, we are going to Connect Tableau to SQL and write the Custom SQL Query against the SQL Data Source. 

SELECT ProdSubCat.EnglishProductSubcategoryName, 
	   Tery.[SalesTerritoryCountry], 
	   Prod.EnglishProductName, 
	   Prod.Color, 
	   Fact.OrderQuantity, 
	   Fact.TotalProductCost, 
	   Fact.SalesAmount, 
	   Fact.TaxAmt, 
          Fact.[Freight],
         Fact.OrderDate
FROM DimProductSubcategory AS ProdSubCat
   INNER JOIN
     DimProduct AS Prod ON ProdSubCat.ProductSubcategoryKey = Prod.ProductSubcategoryKey 
    INNER JOIN
     FactInternetSales AS Fact ON Prod.ProductKey = Fact.ProductKey 
   INNER JOIN
     [DimSalesTerritory] AS Tery ON Tery.[SalesTerritoryKey] = Fact.[SalesTerritoryKey]

Add Reference Distributions in Tableau

In this example, We are going to add Reference Distributions to the Bar Chart.

To do this first, Drag and Drop the Color, English Product Name from Dimension Region to Columns Shelf, and Sales Amount from Measures Region to Rows Shelf, as shown below. By default, Tableau will generate the Bar Chart for you

Add Reference Distributions in Tableau 20

To add Reference Distributions in Tableau, Right Click on the Sales Amount Axis will open the context menu. Please select the Add Reference Line option from it

Add Reference Distributions in Tableau 21

Once you select the Add Reference Line option, a new window called Add Reference Line, Band, or Box will opened to configure the reference Distributions. This article is about adding Reference Distributions. Please select the Distributions Tab, as shown below.

TIP:Please refer to Add Reference Lines in Tableau to add the Reference Lines and Add Reference Bands in Tableau article to understand the configuration of Reference Bands.

From the below screenshot you can observe that we have three options for the Scope region:

  • Entire Table: If you select this option, Tableau will compute aggregation for the whole table and add Reference distributions for the entire table
  • Per Pane: If you choose this option, Tableau will compute aggregation for individual panes inside the table and add Reference Distributions to the individual pane
  • Per Cell: Selecting this option will compute aggregation for an individual cell inside the table and add Reference Distributions to the individual cell

Add Reference Distribution to the Entire Table

To add Reference Distributions to the Entire table in Tableau, Please select the Entire Table option in the Scope region. From the below screenshot you can observe, the available options inside the Entire table Reference Lines option

Add Reference Distributions in Tableau 1

Within the Line region, the Value option will decide the Data used by the reference Distributions. Please select the Measure value we are going to use for creating reference Distributions (Here we are choosing the Sales Amount).

The following are the aggregations available in Percent of options inside the Value field:

  • Total: This option will place lines at the aggregate of all the values of a selected Measure (here it is, Sales Amount)
  • Sum: It put lines at the Sum of selected Measure (here it is, Sales Amount)
  • Constant: This option place lines at the Specified Constant value
  • Minimum: This option will place lines at the Minimum of selected Measure (here it is, Sales Amount)
  • Maximum: This option will set lines at the Maximum of selected Measure (here it is, Sales Amount)
  • Average: This option place the lines at the Average of selected Measure (here it is, Sales Amount)
  • Median: It will put lines at the Median of selected Measure (here it is, Sales Amount)
Add Reference Distributions in Tableau 2

The label allows you to configure whether you want to see the Label or not. This option has different fields:

  • None: If you select this option, Tableau will not display any label for the Reference Distribution
  • Value: This option displays the aggregated value of a measure chosen as a label for the Reference Distribution
  • Computation: If you select this option, Tableau displays the aggregate Function Name or Measure name as a label for the Reference Distribution
  • Custom: Selecting this option display the Custom value you specified in the text box as a label for the Reference Distribution

In this example, we are selecting the Value as a label

Add Reference Distributions in Tableau 3

The formatting region allows us to format the Tableau Reference Distribution Type, Color, Width, and Background color of the Distribution region. The below screenshot will show how we can format the reference Distribution.

Add Reference Distributions in Tableau 4

From the below screenshot, you can observe that We added Light Yellow color to fill the space between the Values or Distribution region.

Add Reference Distributions in Tableau 5

Within the Formatting area, we have the following options:

  • Fill Above: If you checkmark this option, Tableau will add selected color to the region above the Distribution
  • Fill Below: If you checkmark this option, it adds selected color to the area below the Distribution
  • Symmetric: This option adds similar colors to the region above and below the Distribution
  • Reverse: This will reverse the Fill Above color and Fill Below the color

When we checkmark any of the above options, we have to change the Fill property from single color to built-in Pallets as shown below

Add Reference Distributions in Tableau 6

From the below screenshot you can observe that, When we checked the Reverse option, the Fill Above Color and Fill below colors interchanged

Add Reference Distributions in Tableau 7

Click OK to finish adding reference Distributions to bullet Graph. Below screenshot will show you the Reference Distribution for the Entire Table

Add Reference Distributions in Tableau 8

Editing Reference Distribution in Tableau

To Edit the existing Tableau Reference Distributions, Right Click on the Sales Amount Axis will open the context menu. Please select the Edit Reference Line option, as shown below.

Add Reference Distributions in Tableau 9

Let us change the Computation value from Percentages to Percentiles, and Please select the Percentiles from available one or else enter the Custom value. Tableau also allows you to use the existing Parameters or New parameters. For now, we are selecting 80 as shown below

Add Reference Distributions in Tableau 10

Let us change the Computation value from Percentiles to Quantiles, and Please select the Quantiles from available one. Tableau also allows you to use the existing Parameters or New parameters. For now, we have chosen four as shown below

Add Reference Distributions in Tableau 11

This time, we change the Computation value from Quantiles to Standard Deviation. Please write down the Factors for the Standard Deviation. By default, Tableau displays factors as (-1, 1), and we are happy with the same. However, you can change as per your project requirements.

Add Reference Distributions in Tableau 12

Click OK to finish adding reference Distribution of Computation Value as Standard Deviation of Factors (-1, 1). Below screenshot will show you the Tableau Reference Distributions for the Entire table

Add Reference Distributions in Tableau 13

Removing Reference Distributions in Tableau

To remove Reference Distributions in Tableau, Right Click on the Sales Amount Axis will open the context menu. We may have multiple options to remove reference Distributions. For instance,

  • If your tableau report holds only one Reference Line, then you can select the Remove Reference Line option.
  • If your Tableau report holds more than one Reference Line, select Remove Reference Line option, and then select the required reference line.
  • And If you want to remove multiple Reference Line at one go, select Remove All Reference Lines option.
Add Reference Distributions in Tableau 14

Adding Reference Distributions Per Pane

To add Reference Distributions Per Pane in Tableau, select the Per Pane option in the Scope region. From the below screenshot, you can observe we changed the Computation Value of Computation region from 60%, 80% of Average to 30%, 60%, 80% of Average and we change the Fill Pallet to Blue, Yellow within the Formatting region

Add Reference Distributions in Tableau 15

Click OK to finish adding reference Distributions Per Pane to bullet Graph. The below screenshot shows you the Tableau Reference Distributions for the Individual Pane

Add Reference Distributions in Tableau 16

From above, notice that Tableau is finding the minimum value for individual panes and calculating Average for individual panes, rather than the entire table.

Adding Reference Distributions Per Cell

To add Reference Distributions Per Cell in Tableau, Please select the Per cell option in the Scope region. From the below screenshot, we changed the Computation Value of Computation region from 30%, 60%, 80% of Average to 60%, 90% of Average. Next, we changed the Fill Pallet to light Yellow, Unchecked Fill Above, Fill below options within the Formatting region

Add Reference Distributions in Tableau 17

Click OK to finish adding Tableau reference Distributions Per Cell. Below screenshot will show you the Reference Distributions for the Individual Pane

Add Reference Distributions in Tableau 18