3 Replies Latest reply on Oct 21, 2016 11:49 AM by Benjamin Greene

    Fixing an axis based on a filter selection

    jaren.smith

      Hi there.  I am attaching a sample workbook illustrating what I am trying to do though in reality, my data set is much larger and more complex.  My data set represents the course enrollment at two schools over two years where every line of data represents a single student.  We are interested in seeing how enrollment has changed over time but want to be able to filter by a number of different criteria (any combination of subject, course, and gender).  I am currently using Tableau Desktop 10.0.1.

       

      When a user selects a school from the drop-down filter, I want to use a reference line, which I'll then make invisible, to fix the axis for that selection so that when the user selects additional filters for that school, the axis range stays the same as the original range for the entire school.  Right now, my reference line is based on the calculated field called School Max which is given by WINDOW_MAX(SUM([Number of Records])).

       

      When School A is selected, the School Max calculation gives me exactly the value I desire (112) but as soon as I select one of the other filters (subject, for example), it restricts to the max for the selected criteria rather than the entire school.  I completely understand why this is happening -- a filter removes the data from the view -- so it seems like a perfect use for the FIXED LOD calculation, right?  However, I cannot use FIXED with the School Max calculation because it includes a table calculation.

       

      I do realize that this could be done by restructuring my data but I'd like to avoid doing this if possible.  Any help would be greatly appreciated -- thanks!