Dynamic custom insight calculations

Hello, I have a parameter that have two string values “Current Month” and “Previous Month”.
When I click on Current Month, all the visuals display data for the current month that we are in, and vice versa with previous month. I am trying to make a calculation in custom insights that will show this dynamic. When I click on Current Month, I was the custom insight to show the data that pertain to the current month and when i click on previous month in the parameter, i want the custom insight to show data from the previous month. How do i go about that.

Hi @Niam_ucf, welcome to the QuickSight Community, to achieve this dynamic behavior in Amazon QuickSight, you can utilize parameters and calculated fields. Here’s a step-by-step guide:

  1. Create a Parameter:
  • Go to the “Manage Parameters” section in Amazon QuickSight.
  • Create a new parameter called, for example, “Month Selection”.
  • Define two string values: “Current Month” and “Previous Month”.
  1. Create a Calculated Field:
  • Navigate to the dataset you’re working with.
  • Create a new calculated field (let’s call it “Selected Month Data”).
  • Use an IF statement to determine which month’s data to display based on the parameter selection. For example:
IF({Month Selection} = 'Current Month', [your_current_month_data],
   IF({Month Selection} = 'Previous Month', [your_previous_month_data], NULL))

Replace [your_current_month_data] and [your_previous_month_data] with appropriate field references from your dataset.

  1. Build Your Custom Insight:
  • Create a new visual or modify an existing one.
  • Drag and drop the “Selected Month Data” calculated field onto your visual.
  • This visual will now dynamically display data based on the parameter selection.
  1. Test Your Insight:
  • Toggle between “Current Month” and “Previous Month” in the parameter control to verify that the visual updates accordingly.

By following these steps, you’ll have a custom insight that dynamically shows data based on the selected month parameter.

In case you need further assistance with your problem, please create a sample dashboard with sample dataset showing your problem state using Arena and post it here. (Details on using Arena can be found here - QuickSight Arena

We hope this solution worked for you. Let us know if this is resolved. And if it is, please help the community by marking this answer as a “Solution.” (click the check box under the reply)

Hi @Niam_ucf, I am marking this reply as, “Solution,” in case you need further assistance with your problem, please create a sample dashboard with sample dataset showing your problem state using Arena and please create a new post, so we can look at it from a fresh perspective. (Details on using Arena can be found here - QuickSight Arena)