When Comparing a Member to the Group it Belongs To, Group Level Values are Lower Than Expected

Published: 17 Oct 2016
Last Modified Date: 17 Aug 2020


When creating a view that compares a member to a group it belongs to, such as in a chart with two bars, then measure values for the group will be lower than expected.

For example when comparing the state "Washington" to the region "West", then SUM( [Sales] ) for "West" will be the total sales for the region minus the sales for "Washington".


Tableau Desktop


Create a calculated field that returns the measure value fixed to the group level for the group partition in the view.
  1. Create a calculated field with a name like "Header" and a calculation similar to the following:

    IF [State] = [State Parameter]
    THEN [State]
    ELSEIF { FIXED : MIN( IF [State] = [State Parameter] THEN [Regions] END ) } = [Regions]
    THEN [Regions]

  2. Create a calculated field with a name like "New Sales" and a calculation similar to the following:

    IF MIN([State]) = [State Parameter]
    THEN SUM([Sales])
    ELSE SUM( { FIXED [Regions] : SUM([Sales])})

  3. Drag [Header] to the Columns shelf.
  4. Right-click "Null" in the view and select Exclude.
  5. Drag [New Sales] to Text on the marks card.


When creating the initial field to return either the state or region, the region group includes all rows except for the selected state as that row as already been assigned to the state group. Rows in the underlying data cannot be assigned to multiple groups in the same calculated field.
Did this article resolve the issue?