Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
83 | |
76 | |
65 |
User | Count |
---|---|
120 | |
111 | |
94 | |
83 | |
77 |