How to Hide a Column in Tableau
Hiding a column in Tableau is a simple task that addresses all sorts of reporting needs, from cleaning up a visual to enabling complex calculations. Whether you're trying to hide a column used for sorting or one that drives a specific calculation, there are straightforward ways to accomplish it. This guide will walk you through the most common methods for hiding columns, explaining why each technique is useful in different scenarios.
Why Would You Hide a Column in Tableau?
While moving a field off the Rows or Columns shelf will remove it entirely, simply hiding a column serves a different purpose. Hiding keeps the data associated with that column in the view, allowing Tableau to use it for calculations, sorting, or structuring the visualization behind the scenes. You’re simply telling Tableau not to display it visually.
Common reasons to hide a column include:
For Sorting Purposes: You might want to sort a text table by sales in descending order but not actually display the sales figures next to each item. Hiding the sales column achieves this.
To Support Table Calculations: Table calculations like
LOOKUP()orWINDOW_SUM()often need a specific dimension (like Month or Region) to work correctly. Hiding a column lets the calculation run properly without cluttering the final view.To Simplify a Text Table: A wide table with too many columns can be overwhelming. You can hide intermediate fields or extraneous details to make the report cleaner and more focused for your audience.
To Drive Conditional Formatting: You may use a column's values to determine the color, size, or shape of marks in your visualization. Once that's set up, the column itself might not need to be displayed.
Method 1: Using the 'Show Header' Option
The most direct way to hide a single column in a table or crosstab is by deselecting the "Show Header" option. This works for discrete fields (the blue pills) you’ve placed on the Rows or Columns shelves.
This method is perfect when a dimension is used to establish the structure of your view or for sorting, but you don’t need to see its labels. Think of it as making a structural column invisible.
Step-by-Step Guide for a Common Use Case: Sorting
Imagine you have a list of product sub-categories, and you want to display them sorted by total profit, but you don't want the actual profit column visible.
1. Build the Initial Table
Start by building a simple text table. Drag Sub-Category onto the Rows shelf and Profit onto the Text card in the Marks pane.
Your table now shows Sub-Categories and their corresponding Profit. By default, it's probably sorted alphabetically by Sub-Category.
2. Use a Column to Sort the Table
The standard way to sort in Tableau is to use the sort icons, but to make sorting robust and very clear, you can place the sorting field directly on a shelf.
Drag the
Profitmeasure to the Rows shelf and place it right before theSub-Categorypill.By default, Tableau treats measures on the Rows or Columns shelf as continuous fields (green pills), creating an axis. Right-click the
SUM(Profit)pill and select "Discrete." It will turn into a blue pill.
Now your table shows a column for Profit and a column for Sub-Category, with the Sub-Category values correctly sorted based on the profit figure next to them.
3. Hide the Sorting Column
You have the desired sort order, but now you have an extra "Profit" column you want to get rid of without breaking the sort.
On the Rows shelf, right-click the discrete SUM(Profit) pill.
From the context menu, uncheck "Show Header."
Instantly, the profit column disappears from your view, but the sub-categories remain sorted by profit. The data is still there, driving the sort order, its header and values are simply hidden.
Method 2: Using a Table Calculation as a Filter
Sometimes, hiding a column is more about filtering the view without removing the underlying data that other calculations depend on. This is a classic challenge with table calculations.
A standard dimension filter (like filtering on year) removes data at the source. If a calculation like LOOKUP() needs data from 2022 to calculate growth for 2023, filtering out 2022 will cause the calculation to fail.
The solution is to use a table calculation filter. These filters are applied last in Tableau's order of operations, so the view is filtered after other table calculations have already finished computing.
Step-by-Step Guide for Showing Only the Last Period
Let's say you want to build a summary table that shows only sales for the most recent month, along with the month-over-month change. To do this, you need the prior month's data for the calculation but only want to display the current month.
1. Build the View and Add the Table Calculation
Place a discrete
MONTH(Order Date)on the Columns shelf.Place
SUM(Sales)on the Text card in the Marks pane.Now, let's create the "Month-over-Month Change" calculation. Right-click
SUM(Sales)on the Text card, select "Quick Table Calculation" > "Difference."
You now have a table showing marks for Sales and the MoM sales difference for every month in your dataset.
2. Create the Table Calculation Filter
The goal is to show only the last column (December 2023 in the Superstore dataset). To do this, we'll create a calculated field that identifies the very last column in the partition.
Open the calculated field editor (Analysis > Create Calculated Field).
Name the field something like "Show Last Month."
Enter the following formula:
The LAST() function returns the number of cells from the current cell to the last one in the partition. So, LAST() = 0 is only true for the very last cell (e.g., the last month).
3. Apply the Filter
Drag your newly created "Show Last Month" calculated field onto the Filters shelf.
A filter dialog box will appear. Check the box for "True" and click OK.
Your table now magically hides every column except for the very last one. The Month-over-Month difference calculation still works perfectly because Tableau calculated it before the "Show Last Month" filter was applied. You've successfully "hidden" all previous months without breaking your view.
Hiding vs. Filtering vs. Excluding: Key Differences
Understanding the vocabulary is crucial for getting the results you want in Tableau. While these terms sound similar, they perform very different functions.
Hiding a Measure vs. Hiding a Dimension
There is a small but important distinction:
Measures on a visualization:
Typically, right-clicking any "measure value" column, whether in a visual or a crosstab, and deselecting 'Show Header' would remove the header containing the name of the measure such as "SUM(Volume)." However, this won't actually result in having this cell 'gone,' and it is something common to many users, new or experienced.
Hiding the Whole Column, Including Data
How can one actually resolve this issue so its column is truly suppressed/hidden then so it’s gone entirely? It depends on the structure that holds this view.
Structure on Columns/Rows Shelf?
This is important because it controls the whole view.
Dimensions
Let's imagine any scenario, such as a sales overview with:
Customer segment.
Product Category.
Sales Value by Region.
The above example clearly uses at least three fields for our view from one or multiple separate tables. For your scenario, these are:
Customer Segment
Product Categories (as Dimensions)
Sales Revenue (measure) grouped to country Regions, also as Dimensions
The problem arises if your view contains another level, i.e., region, under your customer segmentation. For this example only, we add an additional dimension, Sales channel: e.g., WEB versus Retail.
If the Measure Values Shelf is Being Used
When dealing with a view set up like this, the issue is often resolved by placing some of the measure pills directly onto the Shelf "Measure Value." Using 'hide a card' will instead remove it, displaying the message: 'No measures Name label.'
Hide (Show Header deselected): This focuses on the visual display. It hides the row or column headers but keeps the underlying data in the viz for sorting and calculation purposes.
Standard Filter (on a dimension/measure): This removes raw data before calculations are made. It's like telling Tableau to pretend those rows never existed in the first place.
Table Calc Filter: This is a display-level filter. It hides marks and labels from view after other calculations (like percent of total or month-over-month) have already been processed using the full, unfiltered dataset.
Exclude: This is a quick filtering action. When you right-click a mark or a header in your view and choose "Exclude," Tableau creates a dimension filter behind the scenes to remove that specific selection from the worksheet.
Final Thoughts
Knowing how to hide columns in Tableau is fundamental for creating clean, focused, and powerful dashboards. Whether you're unchecking "Show Header" to remove a sorting column or using a LAST() = 0 filter to display only the most recent data, these techniques help you present insights effectively without overwhelming your users.
We know that mastering functionalities like calculation filters and the order of operations in tools like Tableau takes time. It often involves a lot of manual clicks and adjustments just to get a report looking right. That's why we built Graphed - to eliminate this complexity. Instead of building multi-step calculated fields and filters, you can just ask a question like, "Show me last month's sales compared to the prior month," and instantly get a real-time visualization, letting you skip the busywork and get straight to the insights.