Forum Discussion
TimQ
7 years agoHelper I
Previous period average calculation
I'm seeking to create a visual that displays annual values as a trend line along a fiscal year (text field) axis and a target line that is the calculated window average of the three fiscal year perio...
- Anonymous7 years ago
Hi TimQ
Based on the pbix file provided, I did the following
1. Created a calculated column called Year and set the type to number
2. Created a measure called Average
Average = VAR MaxYear = Calculate(MAX(Sheet1[Year]),ALL(Sheet1) ) Return CALCULATE ( AVERAGE(Sheet1[Amount]), Filter(ALL(Sheet1), MaxYear -Sheet1[Year] >= 1 && MaxYear -Sheet1[Year] <=3 ) )3. Plotted this on the line caahrt as values.
I have attached pbix for your reference
Cheers
CheenuSing
Anonymous
7 years agoNot applicable
Hi TimQ
Based on the pbix file provided, I did the following
1. Created a calculated column called Year and set the type to number
2. Created a measure called Average
Average =
VAR MaxYear = Calculate(MAX(Sheet1[Year]),ALL(Sheet1) )
Return
CALCULATE ( AVERAGE(Sheet1[Amount]),
Filter(ALL(Sheet1), MaxYear -Sheet1[Year] >= 1 &&
MaxYear -Sheet1[Year] <=3 )
)
3. Plotted this on the line caahrt as values.
I have attached pbix for your reference
Cheers
CheenuSing
TimQ
7 years agoHelper I
This appears to work. Thanks Anonymous!