3 Replies Latest reply on Feb 17, 2016 3:53 PM by Nathan Rix

# Find last 3 data points

Hi, I have a measure and a dimension (Match). I want to find the average of the measure for the last 3 matches. I've been trying to use lookup() to do this, but the problem is that there won't always be the same amount of matches. Does anybody know how I might do this? Thanks, Nathan.

• ###### 1. Re: Find last 3 data points

Nathan,

Unfortunately, the information is too poor to start investigating.

Could you share your workbook or sample data as packaged workbook (**.twbx) ?

Thanks,

Shin

• ###### 2. Re: Find last 3 data points

Hi Nathan,

As Shin, we really need more information and preferably a workbook to help us help you. Saying this, a simple Moving Average calculation will help you and you are on the right lines with using a table calc to attempt this though the Window_Avg() table-calc is your friend here

If we knew how you are defining a 'match' then we would be better placed to provide this calculation as it sounds as though your calc hangs-on knowing the number of matches to rll-over.

As a basic example of a seven-day rolling average: Window_Avg(Sum([Sales]),-6,0)

The issue we currently face is knowing the calc behind the "-6" in the calc or in your case, "-2" - you have said it currently needs to go back 3 but as the starting position is base 0, we need to factor the -3 down by 1 to -2.

Steve

• ###### 3. Re: Find last 3 data points

Thanks so much for trying to help. Match is a whole number (From 1 to usually 11 or 12).