1 Reply Latest reply on Feb 6, 2012 5:59 PM by Dimitri.B

    Proper Average Selection

      We are having an issue using the max function on a chart that is creating daily averages. The max function is selecting a detailed value instead of a max average value.


      Please see the attachment for a clear example.

        • 1. Re: Proper Average Selection

          The problem here is that Tableau doesn't know that you want maximum of daily averages, so it calculates maximum of individual values in the raw data. To fix this, you need to use a table calculation that would calculate daily averages and then calculate maximum of those.

          It sounds simple, but it is not. The basic idea is to use something like:


          but then, being a table calculation, it needs to be partitioned properly, which requires the Day dimension added to the sheet, which in turn stacks values one over another, so you need to use this instead:


          which only displays value for the last row of the partition, and that is what I have done here.

          It works for this view, but if you want to use this calculation in a different graph, it may require a more sophisticated approach.