加个“{”花括号括起来试试
DEF(SUM_AGG(金额),[日期],[日期<=EARLIER(日期),日期+7>=EARLIER(日期)])
= SUM(IF(日期 >= DATEDELTA(当前日期, -7) AND 日期 <= 当前日期, 金额, 0))