Попробуйте, если этот стандартный sql работает.
select
t.[date]
,sum(amount) ttl_amount
,(select sum(s.amount) / (select ((count(*) + 1) % 2) + 1 from @table s where s.[date] = t.[date])
from (select s.amount
from @table s
where t.date = s.date
order by s.amount asc
offset (select ((count(*) - (count(*) + 1) % 2) / 2) from @table s where s.[date] = t.[date]) rows fetch next
(select ((count(*) + 1) % 2) + 1 from @table s where s.[date] = t.[date]) rows only ) s ) median
,count(distinct [user]) dst_user
from @table t
group by [date]