Forum Discussion

ChiragPatnaik's avatar
ChiragPatnaik
Regular Visitor
2 years ago
Solved

Comparing with a rolling average.

I am looking to create a rolling average of volume for each symbol. and then set a flag if today's/(the day's) volume for the symbol is higher than this average.  This is what I have right now.  ...
  • rajendraongole1's avatar
    rajendraongole1
    2 years ago

    Hi ChiragPatnaik - Not sure , why my solution is disappeared for this question, again posting on the same thread. please check the below measure for rolling ag. and flag.

     

    RollingAvgVolume =
    CALCULATE(
    AVERAGE(Delivery[TTL_TRD_QNTY]),
    FILTER(
    ALL(Delivery),
    Delivery[SYMBOL] = MAX(Delivery[SYMBOL]) &&
    Delivery[DATE1] <= MAX(Delivery[DATE1]) &&
    Delivery[DATE1] > MAX(Delivery[DATE1]) - 35
    )
    )

     

    create a flag measure as below:

    VolumeFlag =
    IF(
    MAX(Delivery[TTL_TRD_QNTY]) > [RollingAvgVolume],
    "Up",
    "Down"
    )

     

    Did I answer your question? Mark my post as a solution! This will help others on the forum!
    Appreciate your Kudos!!