Forum Discussion

Jelto83's avatar
Jelto83
Frequent Visitor
5 years ago
Solved

ROLLING FORWARD AVERAGE USING WK AND BY PRODUCT

Hello to anyone who can help!   After trawling the internet for hours now trying to source a solution to the following problem; but nothing seems to have covered the criteria of what it is that I'm...
  • AlB's avatar
    5 years ago

    Hi Jelto83 

    I understand it is a calculated column that you're after?  Try this:

    New col =
    VAR currentWeek_ = Table1[Week INDEX]
    RETURN
        CALCULATE (
            AVERAGE ( Table1[FcastSales] ),
            ALLEXCEPT ( Table1, Table1[DIV SKU] ),
            Table1[Week INDEX] >= ( currentWeek_ + 1 ),
            Table1[Week INDEX] <= ( currentWeek_ + 4 )
        )

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers