I am not sure the best approach to this and the simplyest way I can explain this is possibly finding a way to do what peek() does in a chart.
Essentially, I am looking to pull the previous date so that it can be used in a days since calculation. To complicate things I have to be flexible on the previous date as these dates all tie to different locations. Take this example:
From this you can see that Unit1 has two event dates (01/01/15, 03/15/15) and Unit2 has two event dates (02/05/15, 03/25/15). What I would like to do is identify how many days between each event given the selected location and if no location is selected I would return the number of days between event date above it.
I have tried a few different things and I have found that Peek() works pretty well in the script but doesnt account for what location the user might choose.
I like both of these options but I have realized one small issue. If I want to just compare the EventDate to the previous one without regards for Location then these solutions wont work. This isnt a huge deal as I believe I could create a graph with each expression representing a different location.
I guess you can create a separate DaysSince for just Date or you can make Sinan's front end solution to be dynamic so that you can compare it with regards to location or by disregarding location with a button click.
Ultimately it all depends on what your requirement is.