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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Datanik
Frequent Visitor

average in the form of a line on the chart

I'm trying to show the average for the last 90 days as a straight line on the chart, but I only get a moving average. Do you have any ideas how this can be done in a straight line? I will be grateful for any help.

average 3 month =
VAR NumOfMonths = 90
VAR LastCurrentDate = MAX ( perf[Date] )
return
CALCULATE(AVERAGEX(perf,perf[clickk]), DATESINPERIOD (perf[Date], LastCurrentDate, - NumOfMonths, day ))
 
graf.png
1 ACCEPTED SOLUTION
Shaurya
Memorable Member
Memorable Member

Hi @Datanik,

 

Calculate average for the entire duration that you want and ignore any filter context in that measure. Then add a constant line in your visual from the Analytics Pane by using that measure.

 

Did I answer your question? Mark this post as a solution if I did!
Consider taking a look at my blog: Forecast Period - Previous Forecasts

View solution in original post

1 REPLY 1
Shaurya
Memorable Member
Memorable Member

Hi @Datanik,

 

Calculate average for the entire duration that you want and ignore any filter context in that measure. Then add a constant line in your visual from the Analytics Pane by using that measure.

 

Did I answer your question? Mark this post as a solution if I did!
Consider taking a look at my blog: Forecast Period - Previous Forecasts

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.