KNOWLEDGE BASE

Unable to Add Calculated Field to Filters Shelf


Published: 21 Mar 2017
Last Modified Date: 21 Mar 2017

Issue

Unable to add a discrete aggregated calculated field to the Filters shelf. For example, 
IF AVG([Sales]) > 2000 THEN 'Show' ELSE 'Hide' END 
 

Environment

Tableau Desktop 9.1 and earlier versions

Resolution

Option 1: 

Upgrade to Tableau Desktop 9.2 or a newer version. For more information, see Upgrade Tableau Desktop

Option 2:

Use a continuous aggregate. For example, change the following calculation: 
IF AVG([Sales]) > 2000 THEN 'Show' ELSE 'Hide' END 
To: 
IF AVG([Sales]) > 2000 THEN 1 ELSE 0 END 

Option 3: 

Use a table calculation. 
For example, if your field (IF AVG([Sales]) > 2000 THEN 'Show' ELSE 'Hide' END ) is named Avg Sales over 2000, create the following calculated field: 
LOOKUP([Avg Sales Over 2000], 0) 
Then place this field on the Filters shelf. 

Cause

The ability to place discrete aggregate calculations on the Filters shelf was added in Tableau Desktop 9.2. 
Did this article resolve the issue?