I'm guessing [Anchor Date] is a parameter and [Date] is a dimension, so make sure you add an ATTR() every time you use [Date]
IF attr([Date]) <= [Anchor Date] and
attr([Date]) > [Anchor Date] - 7
You're correct in assuming that [Date] is a dimension and that [Anchor Date] is a parameter. However applying this only results in null values.
In the screenshot below, the column "Arrival" is a calculated function applying the weighted average cost formulas. The column is constrained by a [Date] filter capturing 1 week of data. The column "Arrival (wk)" is the one i'm trying to apply the date based if statement to calculate Weighted average cost. For testing purposes, it should match the "Arrival".
Any other suggestions?
You'll need to supply some dummy data so we can figure out what the right answer should be