Video | Tableau | Data visualisation | Analytics

The Rank function in Tableau & all its variants

Find out how to use the Rank function and all its variants.

Part ofTableau Functions
Watch on YouTube
  • The standard RANK function counts descending by default and inserts a gap after duplicate values, so tied items share a rank and the next number skips ahead.
  • RANK_DENSE assigns identical ranks to ties but inserts no gaps, giving a continuous count down the table.
  • RANK_MODIFIED also ties duplicates but places the gap before the next group, pushing the running rank ahead.
  • RANK_PERCENTILE returns a 0-to-1 spread rather than a position, useful for encoding where a value sits in the data, for instance as a colour.
  • You can write a rank calculation directly in a pill, then hold command/control and drag it to the Measure Values shelf to turn it into a reusable calculated field, and you don't need the bracketed [asc]/[desc] placeholders from the documentation.

The RANK function in Tableau has five variants that all handle tied values differently, and knowing which one to use avoids confusion when your ranking numbers don't behave the way you expect.

Tim builds a list of manufacturers ranked by distinct product count using Superstore data, filtered to the top 30, purely as a working example to demonstrate each rank variant.

The Breakdown
  • Set up a ranked list first 0:20

    Before ranking anything, get a measure into the view that you want to rank (here, a count distinct of products per manufacturer), then sort and filter it down to a manageable top N so you can actually see how the ranks behave.

  • Build the standard RANK calculation 2:30

    RANK is a table calculation, found by searching calculation types. Write it directly in a pill by holding command/control and dragging your measure into the brackets rather than typing the field name manually.

  • Standard rank counts descending with gaps 5:10

    By default RANK counts from largest to smallest and, whenever values tie, gives them the same rank then skips ahead — so after two items tied at rank 16, the next item jumps to 18, not 17.

  • Switch ascending/descending without the bracket placeholders 6:21

    You can add asc or desc inside the rank function's brackets to flip the count direction, but you don't need the square-bracket [asc]/[desc] notation shown in the documentation — typing that literally breaks the calculation.

  • RANK_DENSE removes the gaps 8:05

    RANK_DENSE ties duplicate values the same way as RANK, but doesn't skip numbers afterwards, so the count runs continuously to the bottom of the table instead of overshooting.

  • RANK_MODIFIED shifts the gap forward 10:49

    RANK_MODIFIED also assigns identical ranks to ties, but places the resulting gap before the next distinct value rather than after, pushing the running rank ahead earlier than standard RANK does.

  • RANK_PERCENTILE gives a spread, not a position 13:18

    Instead of a rank number, this returns a value between 0 and 1 showing where a row sits within the overall spread of the data — useful when you want that relative position encoded as something like colour rather than shown as a number.

  • RANK_UNIQUE and a shortcut for turning inline calcs into fields 15:24

    RANK_UNIQUE gives every row its own distinct number with no ties at all. As a quick tip, you can type a calculation straight into a shelf pill, then hold command/control and drag it to the Measure Values shelf to convert it into a proper reusable calculated field.

Worth Knowing
  • All five rank variants share the same syntax structure — function, expression, then optional ascending/descending — so once you understand one, the others are easy to read.
  • Ranks here run in the 'table down' direction by default; adding another dimension like category alongside manufacturer would break the ranking because it wouldn't count within groups correctly, which is a topic for a separate table calculations video.
  • Duplicating calculations to build variants quickly is convenient but risks losing track of which one you're editing.
  • The bracketed [asc]/[desc] shown in Tableau's documentation is just illustrative syntax, not something to type literally — a common cause of a broken calculation.
Use It When

Reach for RANK when you need to order values and want control over how ties are handled, and use RANK_PERCENTILE specifically when you want to show relative position in a spread (e.g. via colour) rather than a literal rank number.

How this Rollup was made provenance & method

A Rollup is drafted by AI from the video's transcript, then reviewed and edited by Tim. Everything used to produce this one is listed below — the model, the exact prompt, and the source video — so the process is transparent and reproducible.

Transcription
On-device — NVIDIA Parakeet v3 for recent videos, OpenAI Whisper large-v3 for earlier ones. The transcript never leaves the machine or gets published.
Drafting
Claude Sonnet 5 in the cloud, from that transcript.
Prompt
The exact Rollup prompt (v2) — the full system prompt, unedited.
Source video
Watch on YouTube
Drafted
5 July 2026 at 09:38
Reviewed & edited
5 July 2026 at 09:41 · by Tim Ngwena

Model + prompt + video is everything you'd need to recreate a Rollup like this yourself. The one thing we don't share is the transcript.

Rights. The video and its transcript are the property of TN Media Ltd. Unauthorised use or download is prohibited. © TN Media Ltd.