Articles in this section
Category / Section

Creating Dynamic Dashboards: Filtering Data for 3 Months Before and After Today

Published:

To configure a relative date filter for a dashboard that includes all dates from 3 months before to 3 months after the current date, follow these steps:

Step 1: Create Dashboard Parameters

Set up two parameters:

  • Parameter 1: Represents the last 3 months.
  • Parameter 2: Represents the next 3 months.

Ensure the data type is set to “Date” and the selection type is “Range.” Use the Custom option to define the relative range for each parameter. For example:

  • For Parameter 1: Add a range to include the last 3 months.

    image.png

  • For Parameter 2: Add a range to include the next 3 months.

    image.png

Step 2: Apply the Dashboard Parameters in Code View Mode

In the code view of the dashboard, reference the parameters to filter your data based on the date range.

Sample Query:

SELECT *
FROM [DataSource]
WHERE [DateColumn] BETWEEN @{{:Parameter1.START}} AND @{{:Parameter2.END}}

Step 3: Preview and Validate

image.png

Verify that the parameters are correctly filtering data for the relative date ranges. Adjust as necessary based on the dashboard’s requirements.

image.png

This approach ensures that your dashboard dynamically adjusts to display data for the last 3 months and the next 3 months.


Additional References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
PK
Written by Poovarasan Kandasamy
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied