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

# Fixing an axis based on a filter selection

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!

• ###### 1. Re: Fixing an axis based on a filter selection

Hi Jaren. You are completely correct in your assessment of the problem and the ideal solution (FIXED LOD). The way around the "no table calculations in LODs" error is to make the School Max using an LOD (rather than a table calc) and then nest that within another LOD. Try this:

{FIXED [School] : MAX({FIXED [School], [Year] : SUM([Number of Records])})}

• ###### 2. Re: Fixing an axis based on a filter selection

Thanks for your speedy reply, Benjamin!  This works perfectly and has given me lots to think about--not to mention that it will be a handy trick to have on hand for a number of different projects.  And nested LODs?  Mind blown.

• ###### 3. Re: Fixing an axis based on a filter selection

Glad to help! And at the risk of sounding like a total Tableau nerd, I think LODs are the coolest feature the software has to offer. Once you really start digging into the possibilities with them, things that used to be impossible suddenly become unlocked.