cancel
Showing results for
Did you mean:
New Member

## Compare values of a previous date

Hi,

I managed to import stock data from Yahoo Finance. I used the method discribed here. The result is a table like this:

So I have daily records for mulipte "QuoteSymbols".

I would like to calculate the difference between the "close" of a specific day with the "close" from the previous day.

I tried this measure:

Close previous day = CALCULATE(SUM(StockList[Adj Close]),PREVIOUSDAY(StockList[Date]))

But, because I don't have records for weekends, this is not the correct way to go.

I tried several other solutions, but they don't give me the correct values. I'm not sure to do this with a measure or calculated column.

Can anybody help me finding the solution?

Best regards,

Carla
1 ACCEPTED SOLUTION
Super User IV

@Carla17 , Try a measure like Last Day Non Continuous  in example . with a date table, refer my blog that have more details

Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Day))
Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),previousday('Date'[Date]))

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

Proud to be a Super User!

Super User IV

@Carla17 , Try a measure like Last Day Non Continuous  in example . with a date table, refer my blog that have more details

Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Day))
Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),previousday('Date'[Date]))

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

Proud to be a Super User!

Announcements

#### Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.