Measure Names & Values Overiew with Some Tips & Tricks (Guest Blog Post from Ethan Hahn)

      


The following is a guest blog post from Ethan Hahn (a regular contributor on our site). Ethan works at the University of Cincinnati and runs a small analytics team in the Office of Research. Previously, he spent 27 years at Unifund working with Jeff Shaffer, Dinushki DeLivera, Jennifer Dawes, and myself. This was my first job using Tableau, so I learned a lot from Ethan and we learned a lot together.




INTRODUCTION
If your experience is anything like mine, your first exposure to Measure Name/Measure Values came when you tried to replicate an Excel sheet in Tableau; you dragged a dimension onto Rows, then dragged a measure onto the canvas, dragged another measure there, and boom, all these pills went everywhere!  I didn’t know exactly what they were doing, but who cared – it worked!  Drag more measures on there, move stuff around, and then just move on to the next crisis – this thing’s working!

That was probably my first three years in Tableau – they’d pop up sometimes, but I never paid much attention.  And then one day Kevin and I were trying to do something in Tableau and couldn’t figure out how to do it.  I don’t remember the problem, but we beat our heads against the wall, and after everything we’d tried I was pretty convinced it couldn’t be done.  Note: never tell Jeff Shaffer something cannot be done in Tableau, because he’ll prove you wrong!  Jeff took one look at it and said, “What happened when you used Measure Names and Measure Values?”  Kevin and I probably looked sheepishly at him; he moved a few pills, and it all fell into place.

From that moment, we vowed to use Measure Names and Measure Values anywhere we could, just trying to get familiar with them.  Kevin even wrote it on the whiteboard, where it stayed for months!



WHAT ARE MEASURE NAMES AND MEASURE VALUES?

Let’s start with where they come from.  I’ve loaded Superstore data into Tableau.  Here’s the data tab:




Let’s look at what lives in these fields by putting Measure Names on rows and Measure Values on labels:



Now let’s get back to a crosstab like I mentioned above – the one that was my first introduction to Measure Names and Measure Values.  I’ll put Category on rows, and sum of sales on labels:



Now let’s drag Profit onto the canvas – I’ll drop it right on top of “754,748” – and check out all the changes!




1) It replaced SUM(Sales) on Labels with Measure Values

2) It moved SUM(Sales) down to a new card, the Measure Values Card, and added SUM(Profit) there

3) It put Measure Names on Columns

4) It also put Measure Names on Filters


This is a fantastic illustration of what Measure Names and Measure Values do.  First, think of Measure Values as a mystical portal into the world of the Measure Values Card.  You can load up anywhere from one to all your measures on that card.  Next, you’ve got Measure Names – a blue pill, a dimension – sitting on columns.  Remember, we use dimensions to split data apart – Measure Names is on columns to split out Profit from Sales into separate columns.  Check out what happens without that – I’m just going to remove Measure Names from Columns and leave everything else the same:




Measure Values is on Labels, acting as a portal to the Measure Values Card – anything on that card goes through the portal onto the canvas.  But without Measure Names splitting the data up, it just gets jammed into the same spot!  You’re seeing 754,748 superimposed on 19,730.  But use Measure Names as a dimension and it’ll split the measures back out – put it on Rows:



Move it to the other side of Category:



It’s just a dimension, like any other dimension!  (With one important exception that we’ll address later…)

The other change we saw above was Measure Names on the Filters card – let’s right-click and edit the filter.  Again, it’s just a regular old dimension filter: 




The checked boxes align to the measures on the Measure Values Card.  So the Measure Values filter is just another mechanism you can use to add or remove Measure Values from the Measure Values Card.  You can show this filter then check other boxes, you can drag measure onto the Measure Values Card directly, or in cases like this crosstab, you can drag pills on and off the canvas itself.

Another thing I’d like to note: as I’ve said, Measure Values is just a portal.  Let’s say we add Profit Ratio to our display – I just clicked on Profit Ratio in the Measure Names filter to add it:




It came through as 0 for each row – that’s because the values are below 20%, or 0.2, and with the default formatting they round down to 0.  But I can change the default formatting for Profit Ratio – right click the pill in our field list, select Default Properties, Number Format and change that – and when I do that, it changes the format displayed:




 Again, Measure Values here is acting as a portal – the field-level formatting adheres to the pill and follows it through the Measure Values portal straight onto the canvas.


BAR CHART ILLUSTRATION

We’ve talked a lot about crosstabs so far, but Measure Names/Measure Values are useful for a lot more than just that!  Let’s make a bar chart, sum of sales by Category:




Next, I’m going to replace SUM(Sales) with Measure Values:




Nothing changed on the bars, but we see a bunch of measures on the Measure Values Card.  What happened?  Remember when we pulled Measure Names off Columns above, and ended up with two numbers jammed on top of each other?  That’s the same thing that’s happening here – SUM(Sales) happens to be the biggest measure we have, so without Measure Names to split our data, SUM(Sales) dominates the other measures.  Let’s fix this by adding Measure Names to Columns:





I’m going to make this more manageable by just using Sales, Profit and Quantity.  This time, I’m just going to grab the pills from the Measure Values Card and drag them away – we’re left with this:




Remember that Measure Names is a blue pill – it can go anywhere you’d use a dimension (with that exception I will discuss below).  Let’s drag it from Columns over to Color. Although the chart isn’t all that useful, we get a stacked bar chart, and each measure gets its own color:




CONTROL CHART

This is all well and good, but let’s talk about a cool application that Measure Names/Measure Values makes possible – a Control Chart!  This isn’t really the right dataset for a true control chart, but it will work to illustrate the point.  I’ve got a continuous Day of Order Date on the x-axis, SUM([Profit]) on the y-axis, then I split everything up by putting Order ID on details – a little formatting and I’ve got a nice chart showing the spread of profit amounts by order over time:





Let’s treat this like it’s an industrial process, where we want to know which instances are “in control” – those where the variance from the mean is expected – common cause variation – compared with those where the variance is “out of control” – special cause variation.  You calculate the mean, the standard deviation, and then use those to find the “upper control limit” and “lower control limit” – normally 3x the standard deviation above and below the mean.

NOTE: Please feel free to skip the section below if you don’t care about the details of these calculations – you don’t need to understand them to be able to use them.

Step one, we calculate the mean – note, this isn’t the weighted average, so we can’t just calculate AVG([Profit]); we need to know the profit for each order.  We can do that with a Fixed LOD like this: {FIXED : AVG({FIXED [Order ID] : SUM([Profit])})}



(…from the inside out, we calculate the sum of profit at the Order ID level; then we calculate the average of those sums across the entire viz).

Step two, calculate the standard deviation the same way: {FIXED : STDEVP({FIXED [Order ID] : SUM([Profit])})}



Then we can just use these for the Upper and Lower Control Limits:




Let’s build our control chart.  First, we’ll drag the Upper Control Limit on as a dual axis and do a little formatting (dual axis, synchronize axes, remove all the pills from details and size, change it to a line, change the color): 



But here is where we hit a wall – we can’t add the Lower Control Limit, because we one get one dual axis.

And this is where Measure Names and Measure Values come in!  Measure Values is just a portal to one or more measures, so instead of putting UCL on rows, let’s put Measure Values.  At this first step, it looks like hot garbage:



…by default, Tableau put every single measure on the Measure Values card.  We need to clean those up, just leave on the UCL and LCL:




…and finally, remember that we need to split the measures up using Measure Names:



And there’s your control chart!  We’ve effectively created a triple axis – UCL, LCL and SUM([Profit]) are all on our canvas.  And we could add more measures – throw [Mean Profit by Order] on, whatever else we want.  Now, it’s not quite a triple/quadruple axis, because whatever we add using Measure Names/Measure Values has to have the same chart type.  You can make some changes – like, we could put Measure Names on color and pick different colors for the different lines:



…but they all have to be lines (or whatever chart type they are), all have to be sized and colored by the same pills.


MEASURE NAMES LIMITATION

One other limitation I alluded to above, and one significant difference between Measure Names and any other dimension: you cannot use Measure Names in a calculation.  For example, let’s say we wanted to make the UCL and LCL thick lines, and [Mean Profit by Order] a thin line.  What I want to do is create a calculation: IF [Measure Names] = ‘Mean Profit by Order’ THEN 1.0 ELSE 2.0 END – but that doesn’t work.  Tableau won’t let you type that pill name, you can’t drag it onto the Calculated Field – it doesn’t work.


(Note: there are ways around this, but they introduce their own problems.  For example, you could go into your data source and pivot your measures – that gives you a fields called Pivot Field Names and Pivot Field Values, which you can work with similarly.  However, that also creates three rows for every original row for you to handle, often requiring LODs and other complications)


OTHER FUN TIPS AND TRICKS


1) No Labels


I’ll set up a simple crosstab with Category and SUM([Sales]) – notice that there’s no header for Sales:




One way to address that is to put a literal string on Columns – just double-click where a pill would go and type “Sales”, then Hide Field Labels for Columns:



…but another way is to replace SUM([Sales]) with Measure Values, then put Measure Names on Columns, and then show your Measure Names filter and filter to just Sales:




It’s a few more clicks, but it’s less of a hack, and it’s more flexible.


2) Applying Color Palettes

I’ve got a bar chart – Category on rows, SUM([Sales]) on columns – and I want to use the Lightning Bluegrass color palate.  So I click on color, expecting to see the Edit Colors box that takes me to my palates, but it’s not there:



Once again, you can solve this a few different ways – get the hex code for the color you want; put a dummy field on Color; but again, a flexible solution that gives you access to your color palates is replacing SUM([Sales]) with Measure Values, filtering on Measure Names down to just Sales, then putting Measure Names on color:



3) Format Once, Reuse Over and Over

I put a chart together with a lot of ticky-tack formatting – it’s a lollipop chart, so dual axis, specific sizing, special label formatting, a custom tooltip, all referencing sales totals:




It’s such a brilliant chart (not really, but just humor me for a second) that our executive team wants the exact same viz for profit, and for quantity, and for returns, etc.  That means I have to duplicate this sheet, then find all the references to Sales and swap them out for Profit, then the same for Quantity, etc.

…but instead of building it using Sales, what if I built it using Measure Names and Measure Values?



Now all I have to do is duplicate my sheet, then change the Measure Name in the filter – two clicks and it’s done!



…and note, as we said before, “Measure Values here is acting as a portal – the field-level formatting adheres to the pill and follows it through the Measure Values portal straight onto the canvas.”  If the default format for Profit is currency, that will come through on the viz!

4) Highlight Table

Here’s a crosstab on Subcategory, using Measure Names/Measure Values to show Sales, Profit Ratio and Profit, and I’m going to turn it into a highlight table by putting a continuous measure on color (in this case, Measure Values), and changing the marks to a square:



…and sure, it worked, but look at it – it uses a single scale, which goes from a low value of -17,753 to a high of 335,768.  It’s difficult to see the highest Profit figure, and impossible to see any variation at all in Profit Ratio – it’s all blown out by the massive Sales figures.

But Tableau gave us a feature you may not have noticed before – right-click on the Measure Values pill on color, and it gives you an option to Use Separate Legends:



When you click that, you get one card for each measure, which you can adjust however you like!


CONCLUSION

Measure Names and Measure Values are very handy tools!  They’re key to creating neat and clean crosstabs, they come in handy for a number of convenient tricks, and they’re a great way to extend your viz beyond the limits of the dual axis.  So keep them in mind as you viz (especially when something seems impossible) and maybe even write a reminder on your white board!



Thanks!


Ethan




Need help with anything related to Tableau?  Through Moxy Analytics, Ken and I provide consulting services such as Tableau Lifeline (get us for 1 hour to help solve a sticky problem), Fractional Data Hero (get us on your team for N number of hours a month for whatever you want us for), Tableau Training, and of course, project work. Click the Icon below if you are interested.



Kevin Flerlage, July 21, 2025

Twitter LinkedIn Tableau Public







No comments:

Powered by Blogger.