Hi All
I´m trying to return the CLOSE value of a security from 21 trading days back (with symbol in rows context and a date in filter context).
The closest I got is this:
=CALCULATE(SUM(FactTable[CLOSE]),DATEADD(Calendar[FullDate],-30,DAY))
Not what we´re looking for, as it returns blank values for non-trading days, and the amount of trading days varies.
Looking at how to solve it, I found this great post from Alberto Ferrari:
Alberto Ferrari : Working days computation in PowerPivot
So I created a Calendar table and identified the trading days with a 1.
Now we´d just need to count them backwards from the date filter context and get the “CLOSE” value from 21 trading days before.
Can you share some light to this?
Here´s the spreadsheet with sample data (excel 2013):
https://www.mediafire.com/?g44m1f3kpqclkzn
I highly appreciate your help.
I´m trying to return the CLOSE value of a security from 21 trading days back (with symbol in rows context and a date in filter context).
The closest I got is this:
=CALCULATE(SUM(FactTable[CLOSE]),DATEADD(Calendar[FullDate],-30,DAY))
Not what we´re looking for, as it returns blank values for non-trading days, and the amount of trading days varies.
Looking at how to solve it, I found this great post from Alberto Ferrari:
Alberto Ferrari : Working days computation in PowerPivot
So I created a Calendar table and identified the trading days with a 1.
Now we´d just need to count them backwards from the date filter context and get the “CLOSE” value from 21 trading days before.
Can you share some light to this?
Here´s the spreadsheet with sample data (excel 2013):
https://www.mediafire.com/?g44m1f3kpqclkzn
I highly appreciate your help.