Hey there, data enthusiasts! Ever wondered how to make your Tableau dashboards pop with dynamic unit labels? Stick around, and I’ll guide you through it, step by step.

Why bother?

In my Tableau adventures, I’ve often found the need to make those huge numbers more palatable. Like, wouldn’t it be cooler to see ‘3M’ instead of ‘300K’? Not only does it look sleek, but it also makes data consumption a breeze!

The Game Plan:

The idea here is pretty simple – we’ll tailor-make a calculation based on the value range. This will let our dashboard adjust its unit labels (like K or M) based on the data magnitude. The end result? A dashboard that’s not just pretty, but also super intuitive.

Curious to see this in action? Check out this tableau workbook here.

Or maybe you want the raw data for this tutorial? Grab it here.

Alright, let’s get down to business. We’re going for three dynamic unit levels:

  1. Numbers under 1,000
  2. Numbers from 1,000 up to a million (K)
  3. The big ones – over a million (M)

And trust me, while this sounds fancy, it’s a walk in the park!

Step 1: Crunching the Numbers

  • For those under 1,000:

IF SUM([Sales]) < 1,000

THEN SUM([Sales])

END

  • The K range (1,000 to just under a million):

IF SUM([Sales]) >= 1,000 AND SUM([Sales]) < 1,000,000

THEN SUM([Sales])

END

  • And the big leagues (over a million):

IF SUM([Sales]) >= 1,000,000

THEN SUM([Sales])

END

Step 2: Chart It Out!

With your calculations ready, throw together your favorite chart. Drag all three calculations into the Label pane. Then, give a quick right-click on each pill, setting the format to either K or M, depending on your calculation.

And voilà! You’re now a dynamic label maestro.

Catch you in the next post. Happy visualizing!

 

 

The Data School
Author: The Data School