Forum Discussion
StSupQ
3 years agoFrequent Visitor
How to remove context from a temporary contextually-calculated table-variable ?
Hello all, I am currently working on a moving average measure. The underlying data i want to smooth that way is already a measure. I am already displaying it on a visual as a fonction of a [Time]...
- 3 years ago
Within the definition of the column you're adding using ADDCOLUMNS you can manipulate the filter context in any way you want, or you can manipulate the filter context in a CALCULATETABLE as in the above example where the date is being manipulated.
johnt75
Super User
3 years agoYou can use AVERAGEX over the temporary table,
Avg of measure =
VAR tempTable =
ADDCOLUMNS (
FILTER (
'Table1',
[Time] >= windowStart
&& [Time] <= windowEnd
&& [Perimeter] = perim
),
"Measure Value", [Measure]
)
RETURN
AVERAGEX ( tempTable, [Measure Value] )