Tableau Funtion: RANK_PERCENTILE( )

Tableau Function: RANK_PERCENTILE( )

Category: Table Calculation Functions

Purpose

The RANK_PERCENTILE() function in Tableau is a table calculation that assigns a percentile rank to each row (or mark) within a partition. Instead of returning a whole-number rank (1st, 2nd, 3rd), it returns a relative position expressed as a percentage between 0 and 1.

In simple terms, RANK_PERCENTILE() answers:
“What percentage of values are below this one?”

Type of Calculations

  • Table calculations

  • Relative ranking calculations

  • Distribution-based percentile ranking

  • Post-aggregation analytics

Like other ranking functions, it is evaluated after aggregation and depends on the view’s sort order and partitioning.

Practical Use Cases

  • Identifying top or bottom percentiles

  • Performance benchmarking and segmentation

  • Normalizing ranks across groups of different sizes

  • Creating percentile-based filters (e.g., Top 10%)

  • Comparing relative performance across categories


RANK_PERCENTILE(expression)

ParameterTypeDescription
expressionAggregate / table calculationThe numeric value to evaluate and rank as a percentile. Must be aggregated in the view.

How It Works?

Logical Principle

RANK_PERCENTILE() converts a rank into a normalized percentile:

RANK_PERCENTILE = (Rank - 1) / (Total Values - 1)

Key behaviors:

  • Based on sorted order in the view

  • Accounts for total number of values

  • Tied values receive the same percentile rank

  • Output is scale-independent (always 0–1)

 

What Does It Return?

  • Data Type: Decimal (float)

  • Range: 0 to 1

  • Meaning:

    • 0 → lowest-ranked value

    • 1 → highest-ranked value

    • Values in between indicate relative standing

Example Output

ValueRANK_PERCENTILE()
1000.00
3000.33
5000.67
7001.00

When Should We Use It?

Use RANK_PERCENTILE() when you need to:

  • Compare relative performance regardless of group size

  • Identify percentile-based thresholds (top 10%, bottom 25%)

  • Normalize ranking outputs

  • Perform distribution-based analysis

  • Build dashboards with percentile segmentation

Basic Usage

Calculate percentile rank


RANK_PERCENTILE(SUM([Sales]))

  • Highest sales value returns 1
  • Lowest sales value returns 0

Column Usage

Filter Top 10% of values


RANK_PERCENTILE(SUM([Sales])) >= 0.9

Dynamically selects the top-performing 10%

Segment performance bands


IF RANK_PERCENTILE(SUM([Sales])) >= 0.75 THEN "Top Quartile"
ELSEIF RANK_PERCENTILE(SUM([Sales])) >= 0.5 THEN "Upper-Middle"
ELSEIF RANK_PERCENTILE(SUM([Sales])) >= 0.25 THEN "Lower-Middle"
ELSE "Bottom Quartile"
END

Creates percentile-based groupings

Advanced Usage

Percentile rank within partitions


RANK_PERCENTILE(SUM([Sales]))

(with Compute Using set per Region)

  • Normalizes rankings within each region

Compare percentile rank to parameter


RANK_PERCENTILE(SUM([Sales])) >= [Selected Percentile]

Allows dynamic percentile filtering via parameter

Tips and Tricks

  • Always verify sorting and Compute Using

  • Use percentiles for fair comparisons across uneven group sizes

  • Combine with parameters for interactive dashboards

  • Returns decimals, not whole numbers

  • Sensitive to sort direction in the view

Related Functions

Functions commonly used alongside or as alternatives to RANK_PERCENTILE():

  • RANK()

  • RANK_DENSE()

  • RANK_MODIFIED()

  • PERCENTILE()

  • MODEL_PERCENTILE()

  • INDEX()

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.

1. What does RANK_PERCENTILE() do in Tableau?

It returns the percentile rank of a value within a partition, between 0 and 1.

2. How is RANK_PERCENTILE() different from RANK()?

RANK() returns whole-number ranks, while RANK_PERCENTILE() returns normalized percentile values.

3. How is RANK_MODIFIED() different from RANK_DENSE()?

RANK_DENSE() never skips ranks, while RANK_MODIFIED() may skip minimally.

4. Is RANK_MODIFIED() a table calculation?

Yes, it is evaluated after aggregation and depends on the view layout.

5. When should I use RANK_MODIFIED()?

Use it when you want clear rankings without large gaps caused by tied values.