Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Trouble with rolling average

Hi All!  I try to add a measure with rolling average calculation. Expected result should be as follow: -in the first week of a given year return the value of the measure [Site CTS week] -at next m...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Bibiano_Geraldo ,thanks for the quick reply, I'll add more.

    Hi Anonymous ,

    Regarding your question, I think you can create a virtual table to store the results you get in your visual. Finally, use this virtual table to find the average value you need

    Something like this 

    Measure = 
    VAR _table = SUMMARIZE(ALL('Table'),[ConvertedDate],"Result",[Site CTS Week])
    VAR _CurrentWeek = SELECTEDVALUE('Table'[ConvertedDate])
    RETURN AVERAGEX(FILTER(_table,'Table'[ConvertedDate] <= _CurrentWeek),[Result])

     

     

    Best Regards,
    Wenbin Zhou