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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ValueCreate
Helper I
Helper I

Formula That Only Includes Data Within The Last 5 Years

Hi! I hope I'm able to word this right. I'm essentially asking if theres a way to max out the formula below after 5 years. The formula below is looking back at a historical data. For example, right now its calculating for 6.30.20 by looking back at 6.30.19, 6.30.18, 6.30.17, and all the way until the data begins and taking the average (it is doing the same for the other quarters). But what if I want it to only look back 5 years? (So 6.30.19 until 6.30.15 and then for Q3 it would be 9.30.19 - 9.30.15)

 

Is there a measure I'm able to add so its always taking the average of the last 5 years? And some clients have less than 5 years of data, so I'd think whatever formula is used the clients with less data should be fine.

 

Thanks!

 

 

formulaformulafata formula referencesfata formula references

 

 

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi @ValueCreate 

Just add a conditional in the formula as below:

&&YEAR( 'ValueCreation Ratios' [EffectiveDate])>=YEAR( 'ValueCreation ProjectedQuarters' [ProjectedQuarterEndDate] )-5

 

in the red arrow of this screenshot:

1.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

So adding that conditional formatting did not work. As you can see in the image below all the averages changed (each Q1 should be the same number, and so on for the other quarters) and it removed the last 4 quarters (6.30.25-3.31.26).

 

OG calc1_LI.jpg

Thanks Lin! I will take a look at this next week and let you know if it works.

 

Greg_Deckler
Community Champion
Community Champion

Add an && YEAR([Column]) >= YEAR([Column]) - 5 ?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.