Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

Tableau Aggregate Functions

Tableau provides various Aggregate Functions, which helps you to perform aggregations such as calculating sum, avg, minimum, maximum etc. In this article, we will show you how to use Tableau Aggregate Functions with examples.

To demonstrate these Tableau Aggregate Functions, we are going to use the data source that we created in our previous article. So, Please visit Data Labels in Tableau Reports article.

Tableau Aggregate Functions

The following examples will show you the list of Aggregate Functions in Tableau.

Tableau Sum Function

The Tableau Sum function is used to find the Sum of records in a column. The basic syntax of this Tableau Sum Function is as shown below:

SUM(Expression)

To demonstrate these Tableau aggregate functions, we have to use the Calculated Field. Please navigate to Analysis Tab and select the Create Calculated Field… option to create a calculated field.

Tableau Aggregate Functions 1

Once you click on the Create Calculated Field… option, the following window will be opened. Here, we renamed the default calculation name as Sum_Of_Sales.

As you can see from the below screenshot, while I was typing, Tableau calculation window is showing the suggestions.

Tableau Aggregate Functions 2

For the demo purpose, we will calculate the Sum of Sales Amount. By clicking the OK button, a new field called Sum_Of_Sales will create. And the final Code of Tableau Sum is

SUM([SalesAmount])
Tableau Sum Function 3

Now you can see our newly created Tableau Sum calculated filed

Tableau Sum Function 4

Let me create a Bar Chart by dragging Country to Columns Shelf, Sum_Of_Sales (new calculated field) to Rows shelf, and Country to Colors shelf.

Tableau Sum Function 5

Tableau Avg Function

The Tableau Avg or average function is used to calculate the Average. The syntax of this Tableau AVG Function is as shown below:

AVG(Expression)

As you can see from the below screenshot, we are creating a new field (Sales Average) using Tableau function.

AVG([SalesAmount])

Click OK to close the window

Tableau Avg Function 6

Let me replace the Sum of Sales in Rows shelf with this Sales Average field.

Tableau AVG Function 7

Tableau MIN Function

The Tableau MIN function is an aggregate function in Tableau, which is used to find the minimum value. The syntax of this Tableau MIN Function is as shown below:

MIN(Expression)

As you can see from the below screenshot, we are creating a field called Minimum Sales.

MIN([SalesAmount])
Tableau MIN Function 8

Let me place the Minimum Sales in Rows shelf, and Color dimension in Columns Shelf.

Tableau MIN Function 10

The Tableau MIN function accepts two arguments. Use this to find the smallest between two numbers. Syntax is:

MIN(Expression1, Expression2)

Here, we created a new field, Minimum_Sales_Cost, to find the lowest value between the Sales Amount and Total Cost.

Tableau MIN Function 11

Let me add Minimum Sales_Cost, SalesAmount & Total Product Cost to the chart

Tableau MIN Function 12

Tableau MAX Function

The Tableau MAX function is used to find the maximum value. The syntax of this Tableau MAX is as shown below:

MAX(Expression)

You can see that we are creating a field called Maximum Sales.

MAX([SalesAmount])
Tableau MAX Function 13

Let me replace the Minimum Sales field in Rows shelf with the Maximum Sales field.

Tableau MAX Function 14

In Tableau, the MAX function accepts two arguments. Use this to find the largest among two numbers. Syntax is:

MAX(Expression 1, Expression 2)

Here, we created a new field, Maximum_Sales_By_Cost, to find the largest value among the Sales Amount and Total Product Cost.

Tableau MAX Function 15

Let me add Maximum Sales_By_Cost, SalesAmount, and Total Product Cost to the chart

Tableau MAX Function 16

Tableau VAR Function

The Tableau VAR function is an aggregate function in tableau, which is used to find the Variance of the sample population. The syntax of this Tableau VAR is as shown below:

VAR(Expression)

Here, we are creating a new field called Sales_Variance.

VAR([SalesAmount])

Click OK to close the window

Tableau VAR Function 17

Tableau VARP Function

The Tableau VARP function is used to find the Variance of the entire population. Tableau VARP Syntax :

VARP(Expression)

Let me create a new field called Sales_PVariance.

VARP([SalesAmount])

Click OK to close the window

Tableau VARP Function 18

Let me add those two variances to the column chart

Tableau VAR Function 19

Tableau STDEV Function

The Tableau STDEV function is one of the aggregate functions in tableau, which is used to find the standard deviation of the sample population. The syntax of this Tableau STDEV is as shown below:

STDEV(Expression)

Here, we are creating a new field called Sales_StdDeviation.

STDEV([SalesAmount])

Click OK to close the window

Tableau STDEV Function 20

Tableau STDEVP Function

The Tableau STDEVP function is for finding the standard deviation of the entire population. The syntax of this Tableau STDEVP is:

STDEVP(Expression)

Let me create a new field called Sales_StdDeviationP.

STDEVP([SalesAmount])
Tableau STDEVP Function 21

Let me add those two standard deviations to the column chart

Tableau Aggregate Functions 22

Tableau COUNT Function

The Tableau COUNT function is one of the Tableau aggregate function, which is used to find the number of not null values. The syntax of this Tableau COUNT is as shown below:

COUNT(Expression)

Here, we are creating a new field called Count_Orders.

COUNT([OrderQuantity])

Click OK to close the window

TIP: Use COUNTD function to get a distinct count.

Tableau COUNT Function 23

Let me add this to Tableau Count Row Field.

Tableau COUNT Function 24

Filed Under: Tableau

  • Download and Install Tableau
  • Tableau Start Page
  • Tableau Show Me
  • Connect to MS Analysis Services
  • Connecting Tableau to SQL
  • Tableau Connect to Text File
  • Tableau Connect to Excel File
  • Hierarchies in Tableau
  • Tableau Bins
  • Tableau Parameters
  • Combined Tableau Sets
  • Tableau Set
  • How to Edit Tableau Group
  • Tableau Group
  • Tableau Grouping
  • Tableau First Report
  • Data Labels in Tableau Reports
  • Format Tableau Chart Title
  • Create Folders in Tableau
  • Tableau Sort
  • Add Totals in Tableau
  • How to Join Data in Tableau
  • Tableau Data Blending
  • Tableau Table Report
  • Tableau Crosstab Report
  • Tableau Annotations
  • Tableau Charts
  • Tableau Area Chart
  • Tableau Bar chart
  • Tableau Box Plot
  • Tableau Bubble Chart
  • Tableau Bullet Graph
  • Tableau Bump Chart
  • Tableau Circle Views
  • Tableau Dual Combination Chart
  • Tableau Dual Lines Chart
  • Tableau Funnel Chart
  • Tableau Traditional Funnel Chart
  • Tableau Gantt Chart
  • Tableau Grouped Bar Chart
  • Tableau Heat Map
  • Tableau Highlight Table
  • Tableau Histogram
  • Tableau Cumulative Histogram
  • Tableau Line Chart
  • Tableau Lollipop Chart
  • Tableau Pareto Chart
  • Tableau Pie Chart
  • Tableau Scatter Plot
  • Tableau Stacked Bar Chart
  • Tableau Text Label
  • Tableau Treemap
  • Tableau Word Cloud
  • Tableau Waterfall Chart
  • Tableau Individual Axis
  • Tableau Dual Axis
  • Tableau Blended Axis
  • Tableau Add Reference Lines
  • Tableau Add Reference Bands
  • Add Reference Distributions
  • Tableau Maps
  • How to Create a Map in Tableau
  • Use Google Maps in Tableau
  • Mapbox Maps as a Background
  • WMS Server Map as Background
  • Create a Tableau Dashboard
  • Format Dashboard Layout
  • Create Dashboard Device Prev
  • Tableau Dashboard Objects
  • Create a Tableau Story
  • Tableau Filters
  • Tableau Filters on Dimensions
  • Tableau Filters on Measures
  • Tableau Extract Filters
  • Tableau Dashboard Filters
  • Tableau Data Source Filters
  • Tableau Slicing Filters
  • Tableau Quick Filters
  • Tableau Context Filters
  • Tableau Top Filters
  • Tableau Table Calculations
  • Tableau Calculated Fields
  • Tableau Running Total
  • Tableau Rank Calculation Basic
  • Tableau Rank advanced calculate
  • Tableau Aggregate Functions
  • Tableau Conversion Functions
  • Tableau Case Function
  • Tableau Date Functions
  • Tableau If Function
  • Tableau Logical Functions
  • Tableau Math Functions
  • Tableau String Functions
  • Tableau Table Functions

Copyright © 2021ยท All Rights Reserved by Suresh.
About | Contact | Privacy Policy