Forum Discussion
Rolling 7-Day average calculation.
- 4 years ago
Anonymous , Make sure year, month, and day are coming from date table(in visual) and date table is marked as date table
Try with small change
7 Day Avg V3 =CALCULATE (AVERAGEX ( VALUES ( Dates[Date] ), [Rolling Load to Store Avg] ),DATESINPERIOD ( Dates[Date], LASTDATE ( Dates[Date] ), -7, DAY ),Dates[Date] < TODAY ())Rolling Days Formula: https://youtu.be/cJVj5nhkKBw
Anonymous , Make sure year, month, and day are coming from date table(in visual) and date table is marked as date table
Try with small change
Great that seems to fix the issue. I will select this as the solution. I have one more questions regarding this calc. I am needing to create a seperate measure that will populate based on you're supplied measure calc. I'm hoping you can help out with how to add a measure as filter context to a seperate measure? Below is the "ask".
Process Orders 7 Day Avg =
CALCULATE (
AVERAGEX (
VALUES ( 'Process Orders'[Inspection Point Date] ),
[Rolling Process Orders Avg]
),
DATESINPERIOD (
'Process Orders'[Inspection Point Date],
LASTDATE ( 'Process Orders'[Inspection Point Date] ),
-7,
DAY
),
'Process Orders'[Inspection Point Date]
< TODAY ()
)
I am needing to create a calculation that using the structure of the below filter context. The calc below with work without errors but is the filter context used correctly with this method? Thanks!
New_Calc =
Switch(
True(), [Process Orders 7 Day Avg] > 1, 1,
[Process Orders 7 Day Avg] >0,5,
0
)