I have two date dimension table called Date_Week and Date_Month, these tables have a relationship with the Fact table date field. I want to create a measure that rolls up the usage field from the fact for the last 7 days and the query which I created works fine with one date dimension which is used for the calculation (Date_Week). Is it possible to make it work with both the date dimension based on which dimension is used as a row value?
Below is the DAX query I have created.
Rolling Usage 7 days:=
CALCULATE(
SUM('Fact'Usage),
DATESBETWEEN(Date_week[Day],LASTDATE('Fact'[Date])-7,LASTDATE('Fact'[Date])))
Below are the table and Expected result