How to bind date picker to last available date with custom query-based parameter
This article will guide you on how to bind the selected value of a single-day date picker to the last available date, a relative date (e.g., yesterday), or ideally, to an expression/date column, so that it defaults to this value when the dashboard is loaded.
Steps to bind date picker to last available date with custom query-based parameter
-
Create a custom query-based dashboard parameter: This parameter will return the last date for the specified column.
-
Create an expression using the dashboard parameter: Use the created dashboard parameter in the expression.
-
Drag the date picker widget and bind the expression: Add the date picker widget to your dashboard and bind the created expression to it.
-
Choose the custom option in the filter configuration window: Change the target data source column in the filter configuration window.
-
Select the last date in the date picker widget: The data will be filtered based on the last date.
Before Filter:
After Filter:
By following these steps, you can set the default date in the date picker widget using a dashboard parameter and expression.