Hi there
I am trying to calculate the daily, monthly and yearly stock price returns based on the latest date in the dataset.
My data set has three elements (google drive data provided below):
https://drive.google.com/file/d/1AJVRGyYNoO5uKdCPXILc0x7QSKQ6Qirg/view?usp=sharing
Basically, I two issues:
I've been bashing my head against a wall trying to create a measure for this - close to giving up and going back to excel!!
Any help would be deeply appreciated
Solved! Go to Solution.
@Anonymous . With an independent date table last know price
share price =
var _max = maxx(allselected('DATE'),'DATE'[Date])
var _min = maxx(filter(Table, Table[Date] <_max), Table[Date])
return
calculate(Max(Table[share price]), filter (Table, Table[Date] =_min))
Or with a date table
share price =
var _max = maxx(allselected('DATE'),'DATE'[Date])
var _min = maxx(filter(Table, Table[Date] <_max), Table[Date])
return
calculate(Max(Table[share price]), filter (all(Table), Table[Date] =_min))
share price =
var _max = maxx(allselected('DATE'),'DATE'[Date])
var _min = maxx(filter(Table, Table[Date] <_max), Table[Date])
return
calculate(Max(Table[share price]), filter (all(Table[date]), Table[Date] =_min))
Proud to be a Super User!
@Anonymous . With an independent date table last know price
share price =
var _max = maxx(allselected('DATE'),'DATE'[Date])
var _min = maxx(filter(Table, Table[Date] <_max), Table[Date])
return
calculate(Max(Table[share price]), filter (Table, Table[Date] =_min))
Or with a date table
share price =
var _max = maxx(allselected('DATE'),'DATE'[Date])
var _min = maxx(filter(Table, Table[Date] <_max), Table[Date])
return
calculate(Max(Table[share price]), filter (all(Table), Table[Date] =_min))
share price =
var _max = maxx(allselected('DATE'),'DATE'[Date])
var _min = maxx(filter(Table, Table[Date] <_max), Table[Date])
return
calculate(Max(Table[share price]), filter (all(Table[date]), Table[Date] =_min))
Proud to be a Super User!
Hi Amitchandak
Thank you for your suggestion - am I correct in saying this formula would only work in a filtered data range for a specific KPI etc? Is there an easy way to present this in a concise table for all the tickers?
@Anonymous , Can share an example table of expected output. I will try to create that.
Proud to be a Super User!
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
466 | |
205 | |
116 | |
58 | |
54 |
User | Count |
---|---|
485 | |
249 | |
140 | |
77 | |
71 |