Display a custom message on Insights when no data is returned

Insights are a great way to show meaningful data on your dashboard. You have the choice of including suggested insights that QuickSight provides, or you can create custom insights with your choice of computations.

The example below shows a period over period insight with filters applied for data range and Product.

You might encounter situations where an insight might display a ‘No results’ message when there was no data found, usually due to a filter selection that resulted in no data for the insight.

This article shows how you can capture this message and replace it with a custom message of your choosing, as shown below:

To accomplish this, we will add a new computation of type Unique Values to an insight.
*Note: Ensure that you have a dimension in your insights Categories field. If there isn’t one, add any relevant dimension to the Categories field.

  1. Customize your existing narrative.
    Screenshot 2024-01-02 at 1.08.45 PM

and add a new computation.

1a. Select Unique Values as the computation type:

  1. Add the computation and now the UniqueGroupValues computation will be listed in your insight.

  1. Insert a Block IF code block on the first line of the insights expression editor

  1. Select the UniqueGroupValuesCount field from the computations list on the right. Set the logic to:

UniqueGroupValues.uniqueGroupValuesCount = 0.

This is the condition when no data is returned for your insight.

  1. Click Save, and enter your custom text message to display when this condition is met:

  1. Insert another Block IF statement, and set the logic to:

UniqueGroupValues.uniqueGroupValuesCount > 0.

This is the condition when there is data returned.

  1. Cut and paste the original insight logic into the new block. You code blocks will look similar to the following:

  1. Click on Save and test out your new changes.

Article Disclaimer: Any code shared in Community articles is to be considered a sample and is not endorsed by AWS.

2 Likes