3 Replies Latest reply on Jun 20, 2016 10:18 AM by Yuriy Fal

    Average of Least Four Values under Three Categories

    John de Boer

      Hi there, I’m new to Tableau so please forgive me if this is dead simple, or just dumb.


      I have a very simple data set I’m trying to display. Source data columns include date, Currency (USD, KWR or CAD), and a decimal value ("Return").


      I’d like Tableau to show the average of the least 4 values for each currency, over all dates. I feel like there must be a simple way to do this that I’m missing. Ideally, it looks like this:

      The displayed values are correct averages for the entire data set under each currency. But can I filter the underlying set to the least 4 before the average is performed?


      By sorting the data under each category and using the INDEX() function as a discrete filter, along with a copy of the decimal values as a dimension, I was able to return the 4 least values in each category. I get that this is completely the wrong way to do it, but it seems so tantalizingly close. I want the average of those four values in each Currency category.


      Any ideas would be most welcome. Thank you!