Tableau ATTR() Function Explained with Examples

The ATTR() function in Tableau is one of the most important and commonly used functions, especially when you are working with dashboards, calculations, and aggregated data.

Many beginners get confused when they see an asterisk () in their visualization or when Tableau automatically converts a field into ATTR().

While building a sales dashboard in Tableau, I wanted to display the region name in the worksheet title. But the issue was, when multiple regions were selected, Tableau started showing an asterisk (*) instead of the name.

As a solution, I created a formula field using the ATTR() function in Tableau. This function helps to display a dimension value that might have multiple possible values within the view.

In this Tableau tutorial, I’ll explain what the ATTR function is and how to use it with practical examples.

What is ATTR() Function in Tableau?

The ATTR() function stands for the Attribute function. This function returns the value of the given expression if it has a single value for all rows in the group. If it has multiple different values, then it displays an asterisk (*).

Syntax to use the ATTR () function in Tableau.

ATTR(expression)

Here, the expression can be any dimension field, such as Region, Customer Name, or City. When Tableau processes this function, it applies a simple logic:

  • If there is only one unique value → return that value
  • If there are multiple values → return “*.”

This logic is widely accepted and even explained in technical discussions, where ATTR() is described as returning a value only if it is unique, otherwise returning an asterisk

For