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! Request now

Reply
Anonymous
Not applicable

How to force my table only display last 5 year data by modify the REVENUE AMT expression ?

Hi All

I have a table it will display for last 12 year data , i only need to make the table display last 5 year. I aware that i can make use of year filter to force the table display last 5 year. can some one share with me how to add year filter into my expression ?

My PBI file :-

https://www.dropbox.com/s/9enfu4863y0piws/COMPETITOR_V009.pbix?dl=0

Paulyeo11_0-1607649476304.png

 

1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

If it is me, I will add another column to the Date table and use it as filter to your report. I avoid measure for date tables, my personal preference.

 

Column

 

Is Last 5 Yr = IF ('Date'[Year] >= Year(TODAY()) - 5, 1, 0)

 

Filter

Is Last 5 Yr = 1

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

You may refer to my solution in this Blog article - Flex a Pivot Table to show data for x months ended a certain user defined month.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi ASH

Wow you are excel expert  , you write so many blog.

Paul

Thank you for yoru kind words.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
sevenhills
Super User
Super User

If it is me, I will add another column to the Date table and use it as filter to your report. I avoid measure for date tables, my personal preference.

 

Column

 

Is Last 5 Yr = IF ('Date'[Year] >= Year(TODAY()) - 5, 1, 0)

 

Filter

Is Last 5 Yr = 1

Anonymous
Not applicable

Hi Steven

Can you share with me how to create the new column ? as i get error :-

Paulyeo11_0-1607652303756.png

 

Hi 

Go to the Data tab, Click "Date" on the right and click new column ... 

sevenhills_0-1607652579987.png

 

PS: Based on your image, you are trying to add calculate column on a different table and not on DATE table. 

 

- SV

Anonymous
Not applicable

Hi Steven

Now the table is what i need , for below i set the last 2 year , may i know how to make year label display 2020 and 2019 ? now display as 1 and 0

Paulyeo11_0-1607653245775.png

 

Hi

Since you are power user, I thought you will do and did not tell all the steps...

Select the grid and add the filter (or) you can set as "Filters on this page"

 

sevenhills_0-1607653720590.png

 

I  noticed the formula is giving data for 2015 and above. Change the formula ">=" to ">" if you dont want 2015.

PS: My name is NOT Steven. I am glad to get a new name. 

Thanks

SV

Anonymous
Not applicable

Hi Sevenhills , So sorry that i add one more T after S.

Okay now i understanding your approach. will stick to this approach.

Paul

No need for sorry. Typos happen. (atleast I got a chance to listen new name for me 😉 )

 

Hope you got the solution. 

Regards

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