Forum Discussion
Adding an average line that excludes current month
Hello,
I have the following chart that has an average line
The problem is that I don't want the current month to be included in the average calculation.
Chart axis:
Please help.
Regards
Instead of using the built-in Average line, use the Y-Axis Constant Line and use a measure defined the way you want.
Here's an example measure that excludes the final month:
SpecialAvg = CALCULATE ( AVERAGE ( Table1[Value] ), FILTER ( ALLSELECTED ( Table1[Month] ), Table1[Month] < MAX ( Table1[Month] ) ) )
4 Replies
- AlexisOlson
Super User
Instead of using the built-in Average line, use the Y-Axis Constant Line and use a measure defined the way you want.
Here's an example measure that excludes the final month:
SpecialAvg = CALCULATE ( AVERAGE ( Table1[Value] ), FILTER ( ALLSELECTED ( Table1[Month] ), Table1[Month] < MAX ( Table1[Month] ) ) ) - mircea
Helper I
Thank you Alexis, appreciate your help.
I created this measure but instead of a horizontal line, I get a broken line by month (dark blue).
- AlexisOlson
Super User
It looks like you put it in the visual as a measure instead of a Y-Axis Constant line under the Analytics pane as I suggested.
- mircea
Helper I
Sorry, just learning Power BI now :). Marked as solution!