Tableau comes with many useful built-in calculation functions. In this video, learn how to calculate averages, medians, minimums, and maximums.
- [Instructor] When you analyze business data, you will often want to discover what represents a typical value, and the maximum and minimum of the value range. There are a number of ways to calculate what are referred to as measures of central tendency, but I'll focus on the average and the median. I'll also show you how to find the maximum and minimum values in a dataset. As my sample file, I'll use 05_01_Averages, which is a Tableau workbook you can find in the Chapter 5 folder of the Exercise Files collection. In this workbook, I have a worksheet with the sum of order totals for each of my 13 products. If I want to change the summary operation for Order Total, I can go to the pill on the Marks card, click its down arrow, point to Measure (Sum), and then change it to Average. However, that does not allow me to see the average and the sum at the same time. So I will add a second calculation. To do that, I will double-click on the Marks card, and I'll type AVG, so we're getting the average, left parenthesis, and then left square bracket, and we're doing the Order Total field. So I've got that. I've got the right square bracket. We are expecting a closing parenthesis, so I'll do that, and Enter, and I have the second value. But note that the calculation hasn't been added. That's because it is set as Detail and not Text. It needs to be Text to appear in this column. So I will click the icon to the left of Average Order Total, change it to Text, and the value appears. Unfortunately, the value appears below the sum instead of to the right or to the left of it. In this case, we're looking at the sum versus the average, so it'll be easy to tell which one is which, or if they're both the same, it doesn't matter. However, I actually would prefer separate columns with headers at the top. To make that happen, I will drag Average of Order Total into the Data area. And you see I've got Average to the left and Order Total to the right. If I want to move the Average column to the right, then I got to the Measure Values card and drag Average below Sum, and they switch positions. I can also calculate the median. The median value is the middle value in a sorted order. So for example here, if I sort in ascending or descending order by order total, so I'll click there and I'll sort in descending order, then I see that my lowest total was for Hazelnut and my largest was for Lemon by the case. And if I count down to the seventh item, one, two, three, four, five, six, seven, I see that Mandarin by the case is in the middle. So that would be the median. With that in mind, what I will do is calculate the median sale for each of these 13 products. To create that calculation, I will double-click at the bottom of the Measure values card on a blank space. We're using the MEDIAN function, so M-E-D, and I see MEDIAN. So I'll type, or press the Tab key, and we're using Order Total. So left square bracket, Order Total, that's been entered. Make sure that I don't have any extra parentheses anywhere. I don't. Press Enter, and I get the calculation. So we see that the median, or middle order, for Hazelnut and Basil are the same, basil by the bottle is lower, and so on. And it looks like the highest median is 207 for Lemon, which is consistent with having the highest average and also the highest total. If you want to find the minimum and maximum values, you can create very similar calculations, and I'll go through these more quickly. Double-click the bottom of the Measure Values card, and we'll do MIN, which is for minimum, Order Total, and Enter. And then do the same thing for MAX, M-A-X, then square brackets, Order Total, and Enter. And there we go. And as you can see, there are a lot of different ways to measure your data. Average and median work very well when compared with each other, and minimum and maximum let you know what the extremes are at the edges of your data range.
- Managing data sources and visualizations
- Managing Tableau worksheets and workbooks
- Displaying source metadata
- Creating custom calculations and fields
- Analyzing data using statistical tools
- Sorting and filtering Tableau data
- Defining groups and sets
- Creating and pivoting crosstabs
- Formatting Tableau visualizations
- Creating basic charts
- Annotating and formatting charts
- Mapping geographic data
- Creating dashboards
- Methods for defining an URL-based action
Skill Level Beginner
1. Introduction to Tableau
2. Manage Data Sources and Visualizations
3. Manage Tableau Worksheets and Workbooks
4. Create Custom Calculations and Fields
5. Analyze Data
6. Sort and Filter Tableau Data
7. Define Groups and Sets
8. Develop and Pivot Crosstabs
9. Create Basic Visualizations
10. Format Tableau Visualizations
11. Annotate and Format Visualizations
12. Map Geographic Data
13. Build Dashboards and Actions
14. Tableau 2019.2 Updates
Define parameter actions4m 43s
Next steps1m 6s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.