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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
EpicTriffid
Helper IV
Helper IV

Last three from a specific year

Hi all,

 

I have a column that identifies whether a year is our most recent year for a specific KPI. Some of our KPIs have been released this year, but some others havent been updated since 2017. So, when I'm tabling this all up, I can sometimes see a nicely populated three year table, like below, and sometimes a sparsely populated table, also below:

 

Capture.PNG           Capture1.PNG

 

I know that for the sparsely populated table there are three years of data going back, but because of how of the shifting years, I can't show it without just showing all years from 2012 to 2019. Please ignore the academic year system. My data reads 2019/20 as 2019, 2018/19 as 2018 and so on, so it all works fine. 

Is there a way to build a year measure that show all the dates from a date with a most recent year flag of "Yes" to 3 years back? So for the first table, that would be fine. It would show 2017/18, 2018/19, 2019/20. On the second one, though, it would now only show 2015/16, 2016/17, 2017/18. Voila! Fully populated tables!

I'm thinking the code could look something like:

 

Datesinperiod(Yeardate,"MostRecentYear"="Y", -3,Year)

 

I know that doesn't work, but that's the kind of logic Im looking for?

 

Is this even possible?

3 REPLIES 3
Anonymous
Not applicable

Hi @EpicTriffid ,

Maybe you can take a look at the following blog about using date function to manually defined filter condition and filter range to achieve rolling calculation.

Time Intelligence "The Hard Way" (TITHW)  

In addition, are there any specific filters that existed in your calculation formula? (e.g all, allexpect...) They can also affect the calculation results.

Regards,

Xiaoxin Sheng

Hi @Anonymous 

 

Thanks for the reply. I'm not entirely sure how to apply the blog post to my report. It seems to be more adding up totals rathet than filtering years shown. 

 

Thee the only functions in the data are switches to change the format.

Anonymous
Not applicable

HI @EpicTriffid ,

AFAIK, power bi visual will auto-hide blank/empty records, but it not work on your side. Can you please share some dummy data with same data structure for test? 

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors