Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stjernvd
Partner - Creator
Partner - Creator

Set analysis for min day/min year and max day/max year?

Hi everyone,

So I have been trying for ages in my chart to show the acquisition share price for my stocks and my current share price.

Chart.PNG

My list boxes to sort the data are the following.

List Boxes.PNG

I want the expression in my acquisition price column to show me the share price on the first day of 2012. And I want my expression for my most recent share price to show the share price on the most recent day of the most recent year (in this case last day of 2014).

How do I set this up?

So far I have this:

Sum({$<Day={'$(=Min(Day))'}>}[Close]) for acquisition price

Sum({$<Day={'$(=Max(Day))'}>}[Close]) for current price

But when I click on 2012, 2013, or 2014 it changes the values, and I want only the first day of 2012 (acquisition) to show up and the last day of 2014 (current price). How do I lock the equation so that this is the case and that the values only change if I click on 'Stock'.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like this:

Sum({$<Day={'$(=Min({1} Day))'}, Year=, Month= >}[Close]) for acquisition price

Sum({$<Day={'$(=Max({1} Day))'}, Year=, Month= >}[Close]) for current price

View solution in original post

4 Replies
oknotsen
Master III
Master III

To get the first day of the current year, try this:

= num(YearStart(Today()))

Of course you can replace "today()" by pointing to a field and that way get the first day of the year you selected.

Good luck .

May you live in interesting times!
swuehl
MVP
MVP

Maybe like this:

Sum({$<Day={'$(=Min({1} Day))'}, Year=, Month= >}[Close]) for acquisition price

Sum({$<Day={'$(=Max({1} Day))'}, Year=, Month= >}[Close]) for current price

ramoncova06
Specialist III
Specialist III

ripping from Swuehl

Sum({$<Day={'$(=Min({<{Year=, Month= }>} Day))'}>}[Close]) for acquisition price

Sum({$<Day={'$(=Max({Year=, Month= } Day))'}>}[Close]) for current price


this way your the min and max will only ignore the selection days, but will still take into consideration "Stock"

stjernvd
Partner - Creator
Partner - Creator
Author

Thank you so much!!!