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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
carenel
Frequent Visitor

closer date to a fixed date but the date some years is not included

Hello, I am learning Power bi, I want a new column with the date of 19/11 of every year, but in the row DATE sometimes there is not a date for 19/11 for every year, thus it has to search for the nearer date.

 

Many thanks

 

DATEfuel result: NEAREST DATE 19/11 OF EVERY YEAR
15/11/20010,2894 19/11/2001
16/11/20010,8148 19/11/2001
17/11/20010,1862 19/11/2001
18/11/20010,5821 19/11/2001
19/11/20010,7754 19/11/2001
…...   
15/11/20030,4618 18/11/2003
16/11/20030,4720 18/11/2003
17/11/20030,5426 18/11/2003
18/11/20030,5324 18/11/2003
20/11/20030,4011 18/11/2003
…...   
15/11/20040,6011 16/11/2004
16/11/20040,3605 16/11/2004
20/11/20040,2667 16/11/2004
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=CALCULATE(MAX(Data[DATE]),FILTER(Data,Data[Year]=EARLIER(Data[Year])&&Data[DATE]<=DATE(Data[Year],11,19)))

Hope this helps.

Untitled.png


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=CALCULATE(MAX(Data[DATE]),FILTER(Data,Data[Year]=EARLIER(Data[Year])&&Data[DATE]<=DATE(Data[Year],11,19)))

Hope this helps.

Untitled.png


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

many thanks Ashish very elegant solution

You are welcome.  Thank you for yoru kind words.


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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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