How can I create a calculation to return the Max Date amid two date fields in a table?

I am attempting to capture the most recent date by using a calculated Max Date function. I’d like for the calculation to compare the two date fields and return whichever is most recent. In Excel this is as simple as =max(Date1/Date2), however, I cannot seem to make it work in QuickSight.

Sample Fields:
Date 1: Hire Date Field, Value: 7/29/2019
Date 2: Promotion Date Field, Value: Date 4/2/2020

Sample Output:
4/2/2020

Hi @hssoulie - Welcome to AWS QuickSight community and thanks for your question. Can you please share a sample input and expected output so that community can provide you the right solution.

Regards - Sanjeeb

1 Like

Hi Sanjeeb, thank you for the reply! Please let me know if any other information will prove helpful.

Hi @hssoulie - Thanks for the details. Can you please create a calculate field with below logic.

ifelse(dateDiff({Date 1},{Date 2}) >0,{Date 2},{Date 1})

Hope this will solve your problem.

Regards - Sanjeeb

1 Like