Tableau Funtion: SIZE()
Tableau Function: SIZE( )
Category: Table Calculation Functions
What Is the Function?
Purpose
The SIZE() function in Tableau is a table calculation that returns the number of rows (marks) in the current partition. It tells you how many data points are included in the table calculation’s scope.
In simple terms, SIZE() answers:
“How many rows are in this partition?”
Type of Calculation
Table calculations
Partition-level counting
Context-aware size calculations
Post-aggregation analytics
Unlike COUNT(), SIZE() does not count non-null values in a field—it counts the number of rows in the partition, regardless of measure values.
Practical Use Cases
Normalizing calculations by partition size
Creating averages or ratios without explicit counts
Supporting percentile or index-based logic
Dynamically adapting calculations to changing view sizes
Building advanced table calculations with
INDEX(),FIRST(), orLAST()
SIZE()
| Parameter | Type | Description |
|---|---|---|
| None | N/A | SIZE() has no parameters. Its value depends entirely on the table calculation partition and compute direction. |
How It Works?
Mathematical / Logical Principle
SIZE() evaluates the final set of rows in the partition defined by:
Compute Using
Partitioning
Sorting
Filters in the view
Conceptually:
SIZE() = total number of rows in the partition
It does not change row by row—it is a constant value per partition.
What Does It
Data Type: Integer
Meaning:
Returns the total number of rows (marks) in the current partition
The value is the same for every row within that partition
Example Output
| Row | SIZE() |
|---|---|
| 1 | 5 |
| 2 | 5 |
| 3 | 5 |
| 4 | 5 |
| 5 | 5 |
When Should We Use It?
Use SIZE() when you need to:
Know how many rows are involved in a table calculation
Normalize values based on partition size
Build custom percentile or distribution logic
Support dynamic calculations that adapt to view changes
Avoid hard-coding row counts
Basic Usage
Return the size of the partition
SIZE()
- Displays the number of rows in the partition
- Same value for every row
Column Usage
Normalize index values
INDEX() / SIZE()
- Produces evenly distributed values between 0 and 1
- Useful for percentile-style calculations
Calculate average manually
WINDOW_SUM(SUM([Sales])) / SIZE()
Computes average sales using partition size
Advanced Usage
Dynamic percentile approximation
(INDEX() - 1) / (SIZE() - 1)
- Mimics percentile ranking logic
- Useful for custom ranking and binning
Identify middle row
INDEX() = CEILING(SIZE() / 2)
Flags the median position in a sorted list
Tips and Tricks
Always confirm Compute Using and partition settings
Combine with
INDEX(),FIRST(), orLAST()for advanced logicUseful when view size changes dynamically
SIZE()ignores nulls—it counts rows, not valuesFilters and dimensions directly affect results
Related Functions
Functions commonly used alongside or as alternatives to SIZE():
INDEX()FIRST()LAST()COUNT()WINDOW_COUNT()RANK_PERCENTILE()
We’ve got plenty of resources to help you master Tableau functions. For more details, check out the official Tableau documentation. Or, if you’re ready for more practice, let’s dive into related functions and build your Tableau skills further!
If you’re ready to harness the full power of Tableau and elevate your data analytics capabilities, our expert Tableau consulting services are here to guide you. Whether you need support with building advanced calculated fields, creating dynamic visual dashboards, or optimizing your data sources for peak performance, our team of experienced Tableau consultants delivers customized solutions designed for your business needs. Visit our Tableau Consulting page to discover how we can help your organization turn data into impactful, insight-driven decisions.
It returns the number of rows in the current table calculation partition.
Yes, filters that affect the view also affect the partition size.
Yes, it is evaluated after aggregation and depends on the view layout.
It counts rows, not values, so nulls do not matter.
SIZE() counts rows in the partition, while COUNT() counts non-null values in a field.