What Is an Attribute in Tableau?
The ATTR() function in Tableau can feel like one of those buttons on a microwave you know is useful but have never quite dared to press. You see an asterisk (*) appear, and your first thought is probably "error," but it's actually one of Tableau's smartest ways of telling you something important about your data. This article will walk you through what the Attribute (ATTR) function does, show you practical examples of how it works, and explain when it’s the perfect tool for the job.
So, What Exactly is the ATTR() Function in Tableau?
At its heart, ATTR(), which stands for "Attribute," is an aggregation function. Like SUM(), AVG(), or MIN(), it gathers up multiple values into a single result. However, ATTR has a very specific and simple rule it follows.
Here is its logic, written in plain English:
- Look at all the values in a particular partition (or "mark") in your worksheet.
- Test if all those values are identical. It does this by asking a simple question: "Does the minimum value equal the maximum value?"
- If they are all identical, display that single value.
- If there is more than one distinct value, display an asterisk (*) .
The underlying formula Tableau uses is essentially this:
IF MIN([Dimension]) = MAX([Dimension]) THEN MIN([Dimension]) ELSE "*" END
Think of it like being a concert security guard trying to label a group of friends. If everyone in the group is wearing the same blue t-shirt, the guard can confidently radio in, "The blue-shirt group is coming through." But if the group contains people wearing blue, green, and red shirts, the guard can't label them by a single shirt color. Instead, they'll just say, "A mixed-color-shirt group is here." The asterisk is Tableau’s way of saying “mixed group.”
What That Little Asterisk (*) Really Means
Most beginners see the asterisk and assume it’s an error. It’s not. An asterisk is simply information. It’s Tableau’s signal to you that for the given mark on your visualization, there isn't just one value for the dimension you've applied ATTR to - there are several.
For example, if you have a bar chart showing total sales per product category and you add ATTR([Product Sub-Category]) to the tooltip, hovering over the "Technology" bar will show an asterisk. Why? Because within the Technology category, there are multiple sub-categories (Phones, Computers, Accessories, etc.). The minimum value ("Accessories") doesn't equal the maximum value ("Phones"), so Tableau displays (*) .
The asterisk is a signpost. It prompts you to ask: "Do I expect a single value here, or do I need to break this down further?" It's a key part of the data exploration process, not a bug.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
How Does ATTR() Work in Practice? A Real-World Example
Theory is great, but let's see how this works with some hands-on data. Imagine we have a simple sales table like this:
Our goal is to create a simple table showing the total sales for each salesperson. We'll start by putting Salesperson on a Row and SUM(Sale Amount) on Text. The result locks the level of detail to the salesperson level.
The view shows:
- Anna: $800
- Ben: $750
- Chris: $1,600
Now, let's say our manager wants to see the Region for each salesperson in the table as well. We want to add this piece of information without changing our core visualization - we still want one row per salesperson.
Attempt #1: The Wrong Way
The intuitive first step might be to drag the Region dimension onto the Rows shelf next to Salesperson. As soon as you do this, your view changes. Chris now has two rows:
- Chris | East | $1,200
- Chris | West | $400
This happens because adding Region as a dimension increases the level of detail (also called "disaggregating" the view). Tableau is now forced to show a separate mark for every unique combination of Salesperson and Region. This isn't what we wanted, we lost our simple, one-line summary for Chris.
Attempt #2: The ATTR() Way
Let's undo that and go back to our original one-row-per-salesperson view. This time, instead of adding Region as a dimension, we will drag it onto our view (perhaps onto the Text Shelf) and right-click to change its aggregation to an Attribute.
- Drag Region to the Text mark next to
SUM(Sale Amount). - Right-click the new Region pill and select Measure > Attribute. The pill should now read ATTR(Region).
Now, let’s see what Tableau displays:
- Anna | East | $800: For all of Anna's sales data, the MIN(Region) is "East" and the MAX(Region) is "East." They are the same, so
ATTR()returns "East." - Ben | West | $750: Ben only has one record. The MIN is "West," the MAX is "West" - it returns "West."
- Chris | * | $1,600: For Chris's combined sales, the individual records are "East" and "West." The MIN (alphabetically) is "East," and the MAX is "West." Since they are not equal,
ATTR()returns the asterisk (*).
This is the perfect result! We maintained our single-row summary for each salesperson and correctly identified that Anna and Ben work in a single region while signaling that Chris's total comes from sales across multiple regions.
Key Use Cases for ATTR() in Tableau
This function isn’t just for tables. It’s a versatile tool that shines in several scenarios.
1. Data Blending
This is arguably the most critical use case for ATTR(). When you blend data in Tableau, any field you bring over from the secondary data source must be aggregated. If you want to pull a dimension - like a customer's name from a secondary customer details table - you can't just drop it onto your primary sheet. It has to be wrapped in an aggregation.
ATTR() is the perfect aggregator for this. By using ATTR([Customer Name]), you’re telling Tableau: "If the Primary key links to just one unique Customer Name, show me that name. If it links to several, show me an asterisk." That asterisk is your first sign that maybe your data isn't as clean as you thought or the relationship isn't one-to-one.
2. Enhancing Tooltips and Labels
Often, your main visualization is at a high level of aggregation (e.g., quarterly sales). But you might want to add a useful tidbit of information to the tooltip that only makes sense if it is unique for that quarter - like a Campaign Name for a promotion that ran.
By placing ATTR([Campaign Name]) on the Tooltip mark, your users will see:
- "Q1 Sales: $500,000 | Campaign Name: Super Spring Sale" (if "Super Spring Sale" was the only campaign that quarter).
- "Q2 Sales: $700,000 | Campaign Name: *" (if both "Summer Kickoff" and "Early Bird Deals" ran in Q2).
This adds context intelligently without cluttering the view with data that would be misleading or incomplete.
3. Using Dimensions in Calculated Fields
Tableau often won't let you mix aggregated values (like SUM(Sales)) with non-aggregated values (like [Region]) in a single calculated field. This is known as the "cannot mix aggregate and non-aggregate arguments" error.
Wrapping the dimension in ATTR() solves this, because ATTR() is an aggregation. For instance, the following formula will fail:
// This will cause an error IF [Region] = "West" THEN SUM([Sales]) END
However, this version works perfectly:
// This works! IF ATTR([Region]) = "West" THEN SUM([Sales]) END
This calculation will now only return the sum of sales for marks solely associated with the "West" region.
Be Careful: When Not to Use ATTR()
Like any tool, ATTR() is not always the right choice. Here are the most common scenarios where you should look for an alternative.
1. When You Need to See the Full Breakdown
If you put ATTR([Region]) in a view and see an asterisk, your goal might be to actually see the individual Region values that are producing that asterisk. In our example with Chris, if the goal was to analyze his performance in each region, ATTR() would be an obstacle. The correct action would be to remove the ATTR() function and place the Region dimension directly on the Rows or Columns shelf to increase the level of detail.
Remember: the asterisk is a guide. It tells you there's more detail to uncover if you choose to.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
2. For Aggregating Numbers (Measures)
It’s tempting to use ATTR() on numerical fields, but it’s almost always incorrect. ATTR is designed to test for categorical identity (is this text value the same as that text value?), not to perform mathematical computations. If you have multiple sales figures like $100, $200, and $300, ATTR([Sale Amount]) will simply return *. It won’t sum them or average them. Always use SUM, AVG, MIN, or MAX for numerical measures you want to aggregate mathematically.
3. As a Complete Replacement for Level of Detail (LOD) Expressions
While ATTR is great for checking uniqueness at the level of detail defined by your viz, it can't perform calculations at a different level of detail. For example, if you want to compare each salesperson’s daily sales to their overall average sales, ATTR() won't help you. For that, you’d need a more powerful FIXED or INCLUDE LOD expression, such as {FIXED [Salesperson]: AVG([Sales])}. LOD expressions give you precise control over the context of a calculation, which is beyond the simple check that ATTR() performs.
Final Thoughts
The ATTR() function in Tableau is an elegant and powerful way to check for unique values within the context of your visualization. It helps you add conditional details, troubleshoot data blends, and write valid aggregate calculations without changing your viz’s core level of detail. Instead of fearing the asterisk, think of it as a helpful guide telling you when your data is clean and when it warrants a deeper look.
Learning functions like ATTR() and understanding Level of Detail is a big step toward Tableau mastery, but it highlights the complexity inherent in traditional BI tools. At Graphed, we felt this process should be much simpler. We connect directly to your data sources and allow you to build reports using plain English. Instead of troubleshooting formulas, you can just ask, "Show me total sales per salesperson and include their region," and we'll instantly generate a real-time, interactive dashboard that just works - letting you get insights in seconds, not hours.
Related Articles
Facebook Ads for Carpet Cleaners: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for carpet cleaning businesses in 2026. Get proven strategies for targeting, creative formats, retargeting, and budget that actually convert.
Facebook Ads For Personal Trainers: The Complete 2026 Strategy Guide
Learn how to effectively use Facebook ads for personal trainers in 2026. This comprehensive guide covers targeting strategies, ad creative, budgeting, and optimization techniques to help you grow your training business.
Facebook Ads for HVAC Companies: The Complete 2026 Strategy Guide
Learn how to run high-converting Facebook ads for HVAC companies in 2026. This guide covers targeting, creative strategies, and proven campaigns that drive real leads.