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
TimQ
Helper I
Helper 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 periods prior to the latest or current period. So in the image below, the calculation would average the values from FY17, FY18 and FY19, but dynamically update once a new fiscal year period is added to the data. PBIX is linked here. Thanks.

fiscal trend.PNG

1 ACCEPTED SOLUTION
CheenuSing
Community Champion
Community Champion

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

 

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
CheenuSing
Community Champion
Community Champion

Hi @TimQ 

 

 

If it worked please accept it as solution.

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
CheenuSing
Community Champion
Community Champion

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

 

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

This appears to work. Thanks @CheenuSing!

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.