How to Display Proper Labels in a Bar Chart with Only Measures

Hello,

I’m building a simple dashboard to visualize alarm data. The dataset I receive is fully aggregated—there are no dimensions, only measures. I understand this isn’t ideal for an analytical tool, but I need to make the most of it.

For simplicity, assume my dataset consists of a single row with these metrics:

Active Alarms <12h
Active Alarms 12-24h
Active Alarms >24h

I want to display these values in a bar chart. Since QuickSight requires a dimension, I drag one of these fields into the dimension area just to enable the chart. This results in a chart with three bars showing the correct values. However, my challenge is how to correctly label each bar.

Currently, QuickSight uses the selected dimension for labeling, which doesn’t reflect the actual alarm categories. I can display a legend, but I’d like the correct labels under each bar.

Is there a way to achieve this in QuickSight? Perhaps a workaround using calculated fields or another approach?

Thanks in advance for your help!

Hi Arturo_Munoz,

I hope I understood your question correctly. Please try this:

Create a calculated field (you had the right idea), name it “Alarm Category” and use this formula:

ifelse(
       {Active Alarms <12h} > 0, 'Active Alarms <12h',
       {Active Alarms 12-24h} > 0 , 'Active Alarms 12-24h',
       {Active Alarms >24h} > 0 , 'Active Alarms >24h',
       0)

Notice:
I assume that the different metrics are dummy coded (0,1) and that one row can only have one “active” dimension (two of the metrics have to be “0” and one “1”).

If you have values in more than one metric you have to add more rules to the ifelse-statement.

All the best
Fuchs

Thanks Fuchs,

I tried the solution that you recommended but I can’t get it working, this is what I see if I place the calculated field “Labels” in my dimension:

Labels is calculated as:

ifelse(
    {<12h} > 0, '<12h',
    {12-24h} > 0, '12-24h',
    {>24h} > 0, '>24h',
    'unknown'
)

I also tried with comparisons like:

    isNull({<12h})

I can’t get the bars to display each label, best scenario so far is displaying one value in the x-axis

Thanks again!

Hi Arturo,

I think now I understand the problem ^^.

I think the easiest way is, to create a new dataset:

Pivot the dataset:
So instead of:

  • Metric A
  • Metric B
  • Metric C

You transform it to that:

  • Metric [Metric A, Metric B, Metric C} //This will be your dimension
  • Value // Metric Column

Kind regards
Fuchs

Apart from what @Fuchs has already recommended , take a look if using the highcharts could be an option .

Below is example where I am using 3 measures without a dimension.

Kind regards,
Koushi

Thanks for the suggestions, Fuchs! Pivoting the data would definitely work, but I was exploring alternative workarounds. I’ll be sure to check out Koushik’s recommendations regarding Highcharts.

Hi @Arturo_Munoz,
It’s been awhile since last communication took place on this thread, did you have any additional questions or were you able to find a work around for your case?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!

Hi @Arturo_Munoz,
Since we have not heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!