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

Scatter Plot with EWMA Line

I have month year data on X-axis in a scatter plot. For example (Jan-2024, Feb-2024 etc.) I would like to show EWMA line on teh same scatter plot. 

What are my options.

2 ACCEPTED SOLUTIONS
AnkitaaMishra
Super User
Super User

Hi @rehansaeed2468 , 
Power BI doesn’t have a native EWMA option, but you can achieve this by creating a DAX measure to calculate the EWMA values. Once the measure is created, you can use it in the Analytics (Advanced analytics) section of the scatter plot to display the EWMA as a line.

AnkitaaMishra_0-1765774771581.png

 




View solution in original post

Ritaf1983
Super User
Super User

Hi @rehansaeed2468 

Power BI doesn’t support EWMA (or any other moving-average / trend line) natively in a scatter chart, so there’s no built-in switch for this.

If you still want to show an EWMA line, you basically have three options.

The first option is to calculate EWMA as a DAX measure and plot it together with your original measure in the same scatter chart.
This works, but it’s important to understand the trade-offs: the calculation is relatively heavy, it requires a proper calendar table, and it’s suitable mainly for visualization purposes (not for detailed analysis).

A simplified example of an EWMA measure:

EWMA :=
VAR Alpha = 0.3
VAR CurrentDate =
MAX ( 'Calendar'[Date] )

VAR DatesUpToCurrent =
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] <= CurrentDate
)

VAR WeightedTable =
ADDCOLUMNS (
DatesUpToCurrent,
"t",
RANKX (
DatesUpToCurrent,
'Calendar'[Date],
,
DESC
),
"Value", [Value]
)

VAR Numerator =
SUMX (
WeightedTable,
[Value] * Alpha * POWER ( 1 - Alpha, [t] - 1 )
)

VAR Denominator =
SUMX (
WeightedTable,
Alpha * POWER ( 1 - Alpha, [t] - 1 )
)

RETURN
DIVIDE ( Numerator, Denominator )


The second option is to reconsider the visual itself.
If your X-axis is Month-Year and your Y-axis is a single KPI, you’re effectively working with a time series. In that case, a line chart is usually the more appropriate choice and will make an EWMA line much easier to read, explain, and maintain.

The third option is to pre-calculate EWMA outside Power BI (SQL, Power Query, Python/R) and then load it as a regular column. From both a performance and modeling perspective, this is often the cleanest solution, especially for long time series or production-grade reports.

One important note: if the scatter chart is only being used to show values over time, it doesn’t really add analytical value and mostly introduces limitations. In many cases, switching to a line chart is not a compromise — it’s the correct modeling decision.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
v-hashadapu
Community Support
Community Support

Hi @rehansaeed2468 , Hope you're doing okay! May we know if it worked for you, or are you still experiencing difficulties? Let us know — your feedback can really help others in the same situation.

v-hashadapu
Community Support
Community Support

Hi @rehansaeed2468 , Thank you for reaching out to the Microsoft Community Forum.

 

We find the answer shared by @Ritaf1983  is appropriate. Can you please confirm if the solution worked for you. It will help others with similar issues find the answer easily.

 

Thank you @Ritaf1983  for your valuable response.

kushanNa
Super User
Super User

Hi @rehansaeed2468 

 

Were you able to check the custom visual like Deneb? They had created a sample scatterplot with a line; maybe you can tweak it a little and get it to work for your needs  https://marketplace.microsoft.com/en-gb/product/power-bi-visuals/coacervolimited1596856650797.deneb?... 

 

kushanNa_0-1765798583482.png

 

Ritaf1983
Super User
Super User

Hi @rehansaeed2468 

Power BI doesn’t support EWMA (or any other moving-average / trend line) natively in a scatter chart, so there’s no built-in switch for this.

If you still want to show an EWMA line, you basically have three options.

The first option is to calculate EWMA as a DAX measure and plot it together with your original measure in the same scatter chart.
This works, but it’s important to understand the trade-offs: the calculation is relatively heavy, it requires a proper calendar table, and it’s suitable mainly for visualization purposes (not for detailed analysis).

A simplified example of an EWMA measure:

EWMA :=
VAR Alpha = 0.3
VAR CurrentDate =
MAX ( 'Calendar'[Date] )

VAR DatesUpToCurrent =
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] <= CurrentDate
)

VAR WeightedTable =
ADDCOLUMNS (
DatesUpToCurrent,
"t",
RANKX (
DatesUpToCurrent,
'Calendar'[Date],
,
DESC
),
"Value", [Value]
)

VAR Numerator =
SUMX (
WeightedTable,
[Value] * Alpha * POWER ( 1 - Alpha, [t] - 1 )
)

VAR Denominator =
SUMX (
WeightedTable,
Alpha * POWER ( 1 - Alpha, [t] - 1 )
)

RETURN
DIVIDE ( Numerator, Denominator )


The second option is to reconsider the visual itself.
If your X-axis is Month-Year and your Y-axis is a single KPI, you’re effectively working with a time series. In that case, a line chart is usually the more appropriate choice and will make an EWMA line much easier to read, explain, and maintain.

The third option is to pre-calculate EWMA outside Power BI (SQL, Power Query, Python/R) and then load it as a regular column. From both a performance and modeling perspective, this is often the cleanest solution, especially for long time series or production-grade reports.

One important note: if the scatter chart is only being used to show values over time, it doesn’t really add analytical value and mostly introduces limitations. In many cases, switching to a line chart is not a compromise — it’s the correct modeling decision.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
AnkitaaMishra
Super User
Super User

Hi @rehansaeed2468 , 
Power BI doesn’t have a native EWMA option, but you can achieve this by creating a DAX measure to calculate the EWMA values. Once the measure is created, you can use it in the Analytics (Advanced analytics) section of the scatter plot to display the EWMA as a line.

AnkitaaMishra_0-1765774771581.png

 




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.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.