Use Logic Statements to Filter an Individual Calculation
Published: 09 Oct 2014
Last Modified Date: 22 Dec 2017
IssueHow to return only the measure associated with a specific member of a field, but not filter out the other members of that field.
For example, if you want to return Sales only for the west region, but still access the rows associated with other regions.
ResolutionRather than placing [Region] on the filters shelf, create a calculation that will return only data for the West region, for example:
IF [Region] = "West" THEN [Sales] END
The above calculation will return only sales associated with the "West" region.
Note: You can also use a CASE statement to achieve the same result.
Additional InformationFor more information on using IF and CASE statements, see Logical Functions.
When filtering using the filters shelf, Tableau Desktop will filter all of the marks associated with the dimension member at the lowest level of aggregation. Using the
IF/THEN statement method above will remove certain measure values from the view before the values are aggregated at the level of detail in the view.