SUMMARIZE with external measure

Hello Sam & all,

I have a question regarding SUMMARIZE function. I understand we can use CALCULATE function inside this SUMMARIZE, for instance like below:
SUM ( Sales[Amount] ),
ALL ( Sales[Color] )
This is just an example, but what I want to know is, whether we can add CALCULATE function that using some measure that we created outside of the underlying table.

For example I have a measure that capture user input, it is a Date (lets say As Of Date). Then in my transaction table which I want to summarize, there is a date which I want to calculate the different days between it.

Attached is some example of the date and what summary table I would like as the result.

Thanks in advance,

check out:

You may find SUMMARIZECOLUMNS a better alternative.