Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Tableau table calculation


May 26, 2021 Tableau



These are the calculations of values that apply to the entire table. /b10> For example, in order to calculate run totals or run averages, we need to apply a single calculation method to the entire column. /b11> Such calculations cannot be performed on some selected rows.

Tables have a feature called Quick Table Calculations to create such calculations. The steps applied in a quick table calculation are as follows:

Step 1

Select the measure to apply the table calculation and drag it to the shelf.

Step 2

Right-click the measure, and then select the Quick Table Calculation option.

Step-3

Select one of the following options to apply to the measure.

  • Summary
  • Difference
  • Percentage difference
  • Percentage of total
  • Ranking
  • Percent bit
  • Moving average
  • Year-to-date total
  • COMPOUND growth rate
  • Year-on-year growth
  • Year-to-date growth

Set up visualizations

  1. Open Tableau Desktop and connect to the Sample-Superstore data source that came with Tableau.
  2. Navigate to the new worksheet.
  3. Under Dimensions in the Data pane, drag Order Date to the Columns area.
  4. Drag State (state) to the Rows area from Dimensions in the Data pane.
  5. Under Measures in the Data pane, drag Sales to Text on the Marks card.
  6. Drag Profit to Color on the Mark card from Measures in the Data pane.
  7. On the Tag card, click the Tag Type downlier list and select Block.
    Tableau table calculation
    The visualization will be updated as follows:
    Tableau table calculation

Apply quick table calculations

  1. On the Mark card, right-click SUM and select Quick Table Calculations. N ote: You can only perform quick table calculations on measures in the view. A triangular symbol appears on the field indicating that a quick table calculation is being applied to the field. T he colors in the visualization are updated to show the moving average of profits across years.
    Tableau table calculation

(Optional) custom quick table calculations

  1. On the Marks card, right-click Sum and select Edit Table Calculations.
  2. In the open dialog box, you can configure the following options:
    • How to calculate the aggregation of type values (how to address and partition calculations)
    • More information about these options
    • The visualization updates as you make changes to the calculation. H ighlights and numbers are used to demonstrate how calculations are performed. For example, in the following figure, calculations are performed across tables for each state.
    Tableau table calculation
    If you change this setting, the visualization and highlighted content are updated to indicate the change.
  3. Tableau table calculation