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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.