This is a very tricky situation to handle.
Amazon QuickSight does not support using calculated fields as filters, so you cannot add the value you calculated as the default value for a parameter.
Normally you would have three options:
- Add the desired value as a column (let's say new_date) in your dataset and update it with every refresh (so when you refresh the dataset that column would be calculated again), then use new_date as the default value for your parameter
- Update the value manually (QuickSight GUI)
- Update the value from CLI or Boto3
The first option would be working if Amazon QuickSight supported dynamic defaults for date values. But it does not. So you have only two options: either update it manually or update the value using CLI or Boto3.
The way I overcame it is, I created a Lambda function that updates the 2 date values in my dashboard.
First you need to use UpdateDashboard to update the dashboard parameters, then you need to use UpdateDashboardPublishedVersion to update the published version of the dashboard.
You can do it using a bash script and AWS CLI, or using Lambda functions and Boto3.