Forum Discussion
naivecalf
7 years agoHelper III
Expand rolling data
Hi, I did rolling data by week, for qty_shipped, here is the fomular, Accumulated Shipped = SUMX( FILTER( ALL(Shipped), Shipped[Week_Shipped] >= 27 && Shipped[Week_Shipped]<= MAX(Shipped[We...
naivecalf
7 years agoHelper III
thank you. I tried to remove the condition, it expand to last week, but the total amount calculated a wrong number.
d_gosbell
7 years agoSuper User
Oh yes, I see what that is doing. I don't normally use date columns directly in the fact table for filtering. I usually create a separate date table and then hide the date columns in the fact table. The date table should then have all the dates in the range you want to report on (so maybe all the days in 2019).
Then you could build your calculations using the following pattern
Accumulated Shipped = CALCULATE(
SUM( Shipped[Amt_Shipped] ) ,
SUM( Shipped[Amt_Shipped] ) ,
FILTER(
ALL(Date[Week]),
Date[Week] >= 27 &&
Date[Week]<= MAX(Date[Week]))
)
)