5 Replies Latest reply on Aug 14, 2018 12:48 PM by Raheel Farooq

# Max date but less than or equal to current date

Hi All,

I am trying to create a calculated field on a date field, where I want to pick the max available date but less than or equal to current date?

Sample_Date_field

2017-08-10

2017-04-11

2018-04-25

2018-01-30

2018-08-10

2018-08-11

2018-08-25

2018-11-30

If today is 2018-08-14 then it should return 2018-08-11. Thanks

• ###### 1. Re: Max date but less than or equal to current date

Hi

Have you tried

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 2. Re: Max date but less than or equal to current date

You would do the following

if max([Date]) > Today() then Today()

else max([Date])

end

You may have to use an LOD calc depending on what context you want the max date of.

• ###### 3. Re: Max date but less than or equal to current date

Hi Raheel,

Create a calculated field like below

Attached the workbook

Hope this helps kindly mark this answer as correct or helpful so that it will help others

BR,

NB

1 of 1 people found this helpful
• ###### 4. Re: Max date but less than or equal to current date

Hello Raheel,

Another option is to create a set then create your Max calculation.

Best,

Brandon

• ###### 5. Re: Max date but less than or equal to current date

that was real simple

Max(if Sample_Date_field<=today() then Sample_Date_field end)

1 of 1 people found this helpful