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.
im trying to calculate return on investement for a stock . the formula is : (initial price-currentprice)/initial price
the user wants to know how his return on investment is changing over time. i created a measure to show the
last price for the stock based on the last date in the date slicer filter but it's not working properly
i want the measure to only return the value 144.49 for the maximum selected date in the filter :12-12-2022
another example :
i changed date period to 5-1-2022 ->7-25-2022
the measure in this case should return price 140.82 for last date in the selected range 7-25-2022
Solved! Go to Solution.
Hi @lawada4 ,
Please update the formula of measure [last date close] as below and you can get the correct result... You can find the details in the attachment.
last date close =
var last_date=CALCULATE(MAX('stocks data'[Date]),ALLSELECTED('stocks data'))
return
CALCULATE(SUM('stocks data'[Close]),'stocks data'[Date]=last_date)
Best Regards
Hi @lawada4 ,
Please update the formula of measure [last date close] as below and you can get the correct result... You can find the details in the attachment.
last date close =
var last_date=CALCULATE(MAX('stocks data'[Date]),ALLSELECTED('stocks data'))
return
CALCULATE(SUM('stocks data'[Close]),'stocks data'[Date]=last_date)
Best Regards
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 |
---|---|
105 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |