Forum Discussion

RYOH_0130's avatar
RYOH_0130
Regular Visitor
2 years ago
Solved

Issue with Calculating Cumulative Sales for Same Weekday Last Year

Hello Power BI Community, I am encountering an issue with calculating the cumulative sales for the same weekday last year. Here are the key details of the problem: Same Weekday Last Year: I am ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi RYOH_0130 ,

     

    I did simple samples, mainly for the same weekday screenings last year for the study and you can check the results below:

     

    LastYearSameWeekDay = var _t = ADDCOLUMNS('Table',"a",SUMX(FILTER(ALL('Table'),YEAR([Date])=YEAR(EARLIER([Date]))-1&&MONTH([Date])=MONTH(EARLIER([Date]))&&DAY([Date])>=DAY(EARLIER([Date]))-7&&WEEKDAY([Date])=WEEKDAY(EARLIER([Date]))),[Value]))
    RETURN SUMX(_t,[a])

     

     

    An attachment for your reference. Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.