Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Solved! Go to Solution.
One way to smooth out a line like this is to use a moving average. The following code creates a moving 20 minute average. You can change the number of minutes for the moving average by changing the variable called _minsToAvg
Tank Level Smoothed =
var _minsToAvg = 20
var _dayFraction = _minsToAvg / (24*60)
var _currentDateTime = MAX( data[EventDate])
var _startOfAvg = _currentDateTime - _dayFraction
var result = AVERAGEX (
FILTER (
ALL ( data ),
data[EventDate] > _startOfAvg
&& data[EventDate] <= _currentDateTime
),
CALCULATE(SUM(data[TankLevel]))
)
return result
The above measure produces the following output
One way to smooth out a line like this is to use a moving average. The following code creates a moving 20 minute average. You can change the number of minutes for the moving average by changing the variable called _minsToAvg
Tank Level Smoothed =
var _minsToAvg = 20
var _dayFraction = _minsToAvg / (24*60)
var _currentDateTime = MAX( data[EventDate])
var _startOfAvg = _currentDateTime - _dayFraction
var result = AVERAGEX (
FILTER (
ALL ( data ),
data[EventDate] > _startOfAvg
&& data[EventDate] <= _currentDateTime
),
CALCULATE(SUM(data[TankLevel]))
)
return result
The above measure produces the following output
I am trying this with the data set and i get a circular dependency error?
Could you explain what i am doing wrong?
@Rogiervanweert Use a measure instead of a calculated column.
/ J
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
68 |
User | Count |
---|---|
111 | |
104 | |
85 | |
65 | |
63 |