Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Year over year change in price

$
0
0

Hi all,

 

I'm trying to calculate the year over year change in a stock price for every date / row.  

 

In excel, this was much easier because I would:

 - Sort the tickers alphabetically

 - Verify if there was a stock price from the price year (e.g., offset 1 year)

 - Calculate the variance  

 

The current table has millions of rows and many stock prices

 

I am trying to create a column that shows the yoy change in closing price for any particular ticker on each date:

 

(Dec. 30 2016 closing price - Dec. 30 2015 closing price) / Dec. 30 2016 closing price for each stock

 

I'm very new to BI.  Below was my attempt at a measure...but has not been successful

 

YOY Difference = Calculate(sum('nasdaq_prices_2006-2015'[Closingprice]),dateadd('nasdaq_prices_2006-2015'[Date],-1,year))

 

Any help would be greatly appreciated!

 

Screen Shot 2016-12-30 at 10.53.55 PM.png


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>