Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi to all,
I have a financial data on several Stocks I wish I can anilyze them with a Bollinger bands approach. Thus I started from a 20 days moving average with this formula:
However it does not sum at all (i.e.: each MovingAverage20d item is the same as AdjClose), neither makes the average on them! I attach a screeenshot for further details.
Any ideas?
Thanks
Solved! Go to Solution.
by trying and trying, I got a solution that wonder whether it appears good also for you.
With this code, I may have found the Simple Moving Average of 20 days also taking into consideration the fact that I have several stocks in my table.
@gunicotra , Seem like you need a column, try like
New column =
var _dt = 'History-TopStocks'[Date]
CALCULATE(AVERAGEX(filter( 'History-TopStocks', [Date] >= _dt-20 && [Date] <= _dt) 'History-TopStocks'[Adj Close]))
if you need a measure, with help from date table
Rolling 20 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-20,DAY))
hi amitchandak!
I tried either with your:
Moreover, my table has got several Stocks in it, therefore the moving average calculations should start from the beginning as the stock changes.... difficulty inside the difficulty (at least for me!!)
by trying and trying, I got a solution that wonder whether it appears good also for you.
With this code, I may have found the Simple Moving Average of 20 days also taking into consideration the fact that I have several stocks in my table.
User | Count |
---|---|
93 | |
85 | |
78 | |
68 | |
63 |
User | Count |
---|---|
113 | |
99 | |
96 | |
64 | |
58 |