Created
October 1, 2025 18:37
-
-
Save cbaragao/7d28004726165538060cf80402e82c9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 3 Day Rolling Average 3 = | |
| VAR __MaxOffset = MAX('Calendar'[CurrDayOffset])-1 | |
| VAR __MinOffset = MAX('Calendar'[CurrDayOffset])-3 | |
| VAR __PrevMaxOffset = MAX('Calendar'[CurrDayOffset])-2 | |
| VAR __PrevMinOffset = MAX('Calendar'[CurrDayOffset])-4 | |
| VAR __STDev = CALCULATE(STDEV.P(TimeSeriesData[Value]), ALL(TimeSeriesData)) | |
| VAR __Mean = CALCULATE(AVERAGE(TimeSeriesData[Value]), ALL(TimeSeriesData)) | |
| VAR __T1 = SUMMARIZE(FILTER(ALL('Calendar'),'Calendar'[CurrDayOffset] >= __MinOffset && 'Calendar'[CurrDayOffset] <= __MaxOffset), "__Value", SUM(TimeSeriesData[Value])) | |
| VAR __T2 = ADDCOLUMNS(__T1,"__Previous_Value", CALCULATE(SUM(TimeSeriesData[Value]), ALL('Calendar'),'Calendar'[CurrDayOffset] >= __PrevMinOffset && 'Calendar'[CurrDayOffset] <= __PrevMaxOffset)) | |
| VAR __T3 =ADDCOLUMNS(__T2, "__Percent_Change", DIVIDE([__Value]-[__Previous_Value],[__Previous_Value],BLANK())) | |
| VAR __Result = MAXX(__T3, [__Percent_Change]) | |
| RETURN __Result | |
| Test1 = STDEVX.P(ALL(TimeSeriesData),[3 Day Rolling Average 3]) | |
| Test2 = AVERAGEX(ALL(TimeSeriesData),[3 Day Rolling Average 3]) | |
| Test3 = ABS(DIVIDE([3 Day Rolling Average 3]-[Test2],[Test1])) | |
| Test4 = IF([Test3]>2,1,0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment