@rawadhwal You want to use combination of custom filters and parameters to accomplish this.
Example of customer filter here: Can I use list of attributes in filter
Here’s how I would setup the dashboard.
- Notice the 2 customer filters at the top
- One filter outputs the anchor date as parameter “DT”
- The other filter outputs “duration” as parameter
- Then use these two parameters in the filter shelf of the visual (details below)
The expression used in the Filter shelf:
[Order Date] between date_sub(cast('<<DT>>' as timestamp), interval <<duration>> days) and date_add(cast('<<DT>>' as timestamp), interval <<duration>> days)