Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 57 | |
| 53 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 116 | |
| 105 | |
| 41 | |
| 34 | |
| 25 |