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 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))
@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))
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.
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 |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |