I need to create a QuickSight calculated field that can evaluate a set or column of dates and indicate which one is closest to today’s date. This calculated value needs to be flagged as “True” for the date that is closest to today and “False” for all other dates. I want to use this calculated value as a filter in QuickSight to only display data for the closest date to today from a set of forward dates, not backward.

Let’s take ur example

if today is 06/04/23

Adding column flag and
Dates Flag
31/03. False
01/04. False
10/04. True
15/04. False


Wow @Max … really creative solution. It took some time for me to understand this. You are a gem for all of us.

Regards - San

1 Like

@Max Thank you for your support. I think the code seems quite precise, however for some reason it is not returning what I expected. I have solved it with another approach but I have used three different calculated fields. Can you please check what’s wrong.

@tomsec Can you give me examples of what is off? I don’t know what to check for as it should work.

1 Like