Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Micha3lS
Helper I
Helper I

Moving Average

Hello I have the following data:

Micha3lS_0-1631188330905.png

For the visualisation the OEE data will be shown by Produktgroup in a Linechart. Now i want to add a moving average for each of the 3 productgroups. I tried adding a calculated Column and  tired doing it with a measure but each time i cant add the moving average to the chart.

Micha3lS_1-1631188907744.png

 



Here is the code i tried: 

 

 

Moving Average = 
		AVERAGEX(
			DATESINPERIOD(
				'OEE nach Linie'[Buchungsdatum],
				LASTDATE('OEE nach Linie'[Buchungsdatum]),
				 - 14 , 
				 DAY),
			CALCULATE(sum('OEE nach Linie'[OEE nach Linie]))
			)

 

 

 

I would appreciate some help, im new to Power BI

Thanks in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Micha3lS , You can create a measure like

 

Moving Average =
AVERAGEX(values('OEE nach Linie'[productgroups])
,
CALCULATE(sum('OEE nach Linie'[OEE nach Linie]),DATESINPERIOD(
'OEE nach Linie'[Buchungsdatum],
LASTDATE('OEE nach Linie'[Buchungsdatum])
- 14 ,
DAY))
)

 

Seem like this scatter visual, Go and add constant line, in new version there is Fx, click on that and take this measure)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Micha3lS , You can create a measure like

 

Moving Average =
AVERAGEX(values('OEE nach Linie'[productgroups])
,
CALCULATE(sum('OEE nach Linie'[OEE nach Linie]),DATESINPERIOD(
'OEE nach Linie'[Buchungsdatum],
LASTDATE('OEE nach Linie'[Buchungsdatum])
- 14 ,
DAY))
)

 

Seem like this scatter visual, Go and add constant line, in new version there is Fx, click on that and take this measure)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.