Off-Label Uses for Measure Names and Measure Values in Tableau

Data

Off-Label Uses for Measure Names and Measure Values in Tableau

Sometimes, I feel like I’m cheating the system when I find a neat way to use something that Tableau has to offer. Other times, I feel like a genius for doing an end run around them. Is that bad? Well, either way, I’m here to show you how to use Measure Names and Measure Values to solve a couple of formatting conundrums, and I hope they make you as happy as they’ve made me!

Single-Column Headers – Dance with The One Who Brung Ya

Imagine you’ve been tasked with creating a very simple chart that shows you sales by Category in tabular form. One text table to go, please! Using Superstore Sales as our data source, here’s what we get:

Tableau text table, no column header

All’s well and good, except we note that with only one measure in the view, there is a distinct lack of column header. Ugh. The science behind that speaks to the difference between blue and green fields, and how Tableau handles them. Green fields are continuous, and as such, they give you an axis and a Marks card. Blue fields, by contrast, are discrete. They will always and forever give you a column/row header in your view.  (You can hide or show this header if the situation calls for it, but it’s “there” nonetheless.)

So, how do you get a green field to give you a column header when that’s something only blue fields are supposed to do? Use Measure Names and Measure Values! Measure Names is a dimension, the members of which are the names of all measures in your data source, including any calculated fields you might have added (BONUS!). Measure Values is the corresponding placeholder that represents the measures that you want to use in the view.

Even though we only have a single measure in our view above, we can still take advantage of MN/MV (< -- That’s “cool kid” speak for Measure Names/Measure Values) to get us what we want. Here’s what you do:

  1. Bring your dimension(s) into the view, whatever it is you want to break your measure down by.  In my example above, I used Category from Superstore Sales.xls, which is a data set that ships with Tableau.
  2. Bring Measure Names to the Filters shelf and choose the single measure you want to include in your view:
    Choose measure
  3. Next, take Measure Values and bring it onto Text on the Marks card:
    Bring Measure Values to Text
    This puts the values of your Sales field, the measure that I selected in the Measure Names filter, into the view with a Mark Type of text.
  4. To add the column header, bring in Measure Names again, placing it on the Columns shelf.  You’ll need to either hold down the CTRL key and click-and-drag Measure Names from the Filters shelf, or click another copy of Measure Names from the Data window and drag it in:
    Bring Measure Names to Columns

BAZINGA! We have our single-measure column header. Say that ten times fast while hopping on one foot. I dare you.

But Wait, There’s More!

Another small annoyance with single measure views is that it’s not easy to color your marks using a custom color palette (for more information on how to create a custom color palette, click here).  When you bring a single measure into a view, like in a bar chart for example, Tableau will always go with a default blue color:

Tableau default blue

I’m totally OK with that because blue’s my favorite color. But if you’re dealing with a client who has a specific shade of blue that you want to use, or your marketing department has provided you with specific RGB or Hex color values that you need, then default Tableau blue is not your friend.

We could change it to our custom color by clicking the Color button on the Marks Card, but we don’t get the Edit Colors dialog that allows us to choose a new palette. Instead, we get this:

Tableau Color menu

The odds of the color you need being in that little list are slim. So, you have to click More colors…  Then we get a bigger set of options, and we can even input the RGB or Hex values that our marketing folks have provided:

More colors...

All good news, but there again, it falls short of giving me the Edit Colors button that I can click to see my custom color palettes and choose one. 

So, how do we solve this? Same way we did above, by using MN/MV. Once again, we’ll drag Measure Names to the Filters shelf and choose our measure. But then, we’ll drag another copy of Measure Names onto Color on the Marks card, configuring our view like so:

Drag Measure Names everywhere ...

Then, with Measure Names on Color, we can click the button and voila! Up comes our Edit Colors… dialog:

Edit Colors...

From here, we can choose our desired palette:

Edit Colors > Palettes” src=”/wp-content/uploads/sites/default/files/blog-content/OffLabel10.png” /></p><p>Note the single measure under <strong>Select Data Item</strong>. That’s exactly what we wanted, and MN/MV is the way to get there.</p><p>There you have it: A couple of off-label uses for Measure Names/Measure Values that allow you to boldly go where no other viz has gone before! Or, with slightly less hyperbole, to boldly go where you need to go but can’t intuitively arrive without a workaround!</p></div><div id=

More About the Author

Stephanie Kennedy

Analytics Consultant
Do I Need New Running Shoes? Let the Data Decide I gave up getting angry for Lent this year, so I won’t start this blog post ranting about how difficult it is to get my data out of my ...
Off-Label Uses for Measure Names and Measure Values in Tableau Sometimes, I feel like I’m cheating the system when I find a neat way to use something that Tableau has to offer. Other times, I feel ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072