Questions from Tableau Training: Labeling with Table Calculations

Data

Questions from Tableau Training: Labeling with Table Calculations

Our Certified Tableau Trainers are asked a myriad of questions each day. In this series, they share some answers.

Continuing with the ‘Questions from Tableau Training’ series, I was asked a labeling question with regards to a time series chart. The question was:

“How you can get multiple labels combined into one tooltip?”

The example that we were working on was a time series chart for Sales by Customer Segment in the Superstore data set that comes with Tableau. The desire was for the tooltip to contain all data for the specific date.

By default, Tableau only places the data revolving around the single mark in the tooltip. Looking at the screenshot below, you can see that we only see Corporate Sales Amounts on the mark we are hovering over. 

Corporate Sales Amounts Hover

In order to be able to get all three marks for each date to appear in the tooltip, we need to create a calculated field that uses the table calculation function TOTAL(). We need to identify the customer segment line, and return the sales amount for the line, per date. The formula we ended up using looks like this:

Consumer Sales Formula

Using an IF Statement, we identify the Customer Segment Line and return the Sales Amount. To be able to use the TOTAL table calculation function, all fields must be aggregate. That’s why we added Sum to the formula. 

Since we have three lines in the chart for Customer Segment, we must create three calculated fields. Once these three fields are created, place them on the Tooltip shelf in the Marks card. “Right Click” each pill, and compute the table calc using Cell. This gives us the Total for each segment, per each date, based on the way we’ve built the chart. I’ve modified the Tooltip layout to look like the one below: 

Edit Tooltip

When you hover on your mark in your chart now, all three marks for that specific date appear for comparison. 

Updated Hover

I’m sure there may be other ways by which people have solved this issue, but this is the solution that we came up with for our specific scenario and time available. If you have another method you’ve used to solve this before, I’d love to see it. Feel free to email me at dustin.wyers@interworks.com.

You can also check out other “Questions from Tableau Training” posts here.

All the best! 

Want More Questions from Tableau Training

  1. Questions from Tableau Training: Quick Filter Interaction
  2. Questions from Tableau Training: Labeling with Table Calculations
  3. Questions from Tableau Training: Speeding Up Presentation Views when Using Tableau
  4. Questions from Tableau Training: Dashboard Actions
  5. Questions from Tableau Training: Business Day Calculations
  6. Questions from Tableau Training: Adding Gaps Between Bars
  7. Questions from Tableau Training: When to Pivot Data in Tableau
  8. Questions from Tableau Training: Adding Conditional Formatting
  9. Questions from Tableau Training: Setting Weekday Start
  10. Questions from Tableau Training: How Do ZIP Codes Work in Tableau?
  11. Questions from Tableau Training: The Small Grey Bar Within a Quick Filter
  12. Questions from Tableau Training: Matching Mark Color
  13. Questions from Tableau Training: Showing the Null Indicator
  14. Questions from Tableau Training: Can I Manually Set the Colors of a Stepped Gradient?
  15. Questions from Tableau Training: How Can I Get Box Plot Data into a Crosstab?
  16. Questions from Tableau Training: How Do I Clear a Worksheet? Make a Copy?
  17. Questions from Tableau Training: Opening URL Actions Inside of a Dashboard
  18. Questions from Tableau Training: Can I Move Mark Labels?
  19. Questions from Tableau Training: How Can I Use My Current Report to Create a Viz?
  20. Questions from Tableau Training: Can I Create Text Hyperlinks on a Dashboard?
  21. Questions from Tableau Training: How Can I Transform My Crosstab into a Flat List?
  22. Questions from Tableau Training: Labeling the Top N
  23. Questions from Tableau Training: How Can I Customize Charts with Parameters?
  24. Questions from Tableau Training: Combining Measures into a Single Line
  25. Questions from Tableau Training: How Can I Create Custom Color Palettes?
  26. Questions from Tableau Training: Can a Top N Parameter be Nested Within Other Fields?
  27. Questions from Tableau Training: Conditional Scope on Tableau Calculations
  28. Questions from Tableau Training: Top Ten Plus N
  29. Questions from Tableau Training: Dynamic Label Positioning
  30. Questions from Tableau Training: Using Cross Joins to Solve Active Tickets
  31. Questions from Tableau Training: Top N Highlight Table
  32. Questions from Tableau Training: How to Use Specific Dimensions in Table Calculations
  33. Questions from Tableau Training: Moving Reference Line Labels
  34. Questions from Training: Comparing Metrics for Same Weekday in Previous Year
  35. Questions from Tableau Training: Colouring Specific Columns and Rows in a Crosstab
  36. Questions from Tableau Training: Creating a Custom Legend as a Sheet
  37. Questions from Tableau Training: How Can I Draw a 45-Degree Angle?
  38. Questions from Tableau Training: Down the Aggregation Rabbit Hole
  39. Questions from Tableau Training: Percent Change from Previous Period on a Map
  40. Questions from Tableau Training: Union File Names as Years
  41. Questions from Tableau Training: Conditional Coloring on Sparklines
  42. Questions from Tableau Training: Moving Column Headers to the Top of the View
  43. Questions from Tableau Training: Isolating Rank with Parameters and Calculations

More About the Author

Dustin Wyers

Analytics Consultant | Assist Lead - East
Advance with Assist: Filling in Null Records Without Filtering Question: I’m using a table calculation comparing the same month last year, and my view shows blanks due to the date range I have ...
Advance with Assist: Swapping Sheets in Tableau 2019.2 Tableau 2019.2 is full of new features. To name a few, vector maps, parameter actions, show/hide dashboard containers and spatial ...

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