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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
IlMoro
Helper II
Helper II

PowerBI Report Builder filter expression "EndOfYear"/"StartOfYear"

Hi,

 

I have a report that I succeeded in filtering based on a date column that has a date older than 5 years from today:

 

IlMoro_1-1715177504921.png


The expression inside "Value" is:

 

 

=DateAdd(DateInterval.Year, -5, NOW())

 

 

 

I need now to define in the expression, instead of today date, the end of the actual year (and even, in onother filter, the start of the actual year.

 

Thanks for any help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @IlMoro ,

Below is my table:

vxiandatmsft_0-1715220170225.png

The following Expression might work for you:

DateDiff("yyyy",Format(Fields!Date.Value,"Long Date"),Now())

The final output is shown in the following figure:

vxiandatmsft_1-1715220283593.pngvxiandatmsft_2-1715220295087.png

Best Regards,

Xianda Tang

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

View solution in original post

2 REPLIES 2
IlMoro
Helper II
Helper II

Hi @Anonymous , it is not clear for me what I have to do.

I have just a dataset containing assets details and a column that contains the purchase date (dd/mm/yyyy).

I need to filter the dataset so it show just those assets having a purchase date that is 5 years old from the end of the current year.

Anonymous
Not applicable

Hi @IlMoro ,

Below is my table:

vxiandatmsft_0-1715220170225.png

The following Expression might work for you:

DateDiff("yyyy",Format(Fields!Date.Value,"Long Date"),Now())

The final output is shown in the following figure:

vxiandatmsft_1-1715220283593.pngvxiandatmsft_2-1715220295087.png

Best Regards,

Xianda Tang

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

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.