Coloring a stacked bar chart to show values above and below the average – Qlik Sense


This video shows you how to create a stacked bar chart That has a different color for values that are above
and below the average To highlight the proportion between the two values To do this we are going to create two master measures The first will calculate the values above the average And the second will calculate the values below the average In the first master measure, we are going to add an expression That will include only above measures We will label this measure: Sales above average And we are going to assign a custom color to this measure For example, green Then, we are going to create the second
master measure In this case we are going to use an expression That will include values above and below average We will label this master measure:Sales
below average Then we assign a custom color to it,
in this case dark gray Now we are going to create a bar chart As a dimension, we add month Then, we are going to add the two master measures that we just created And, in appearance,
we select the stacked option As you can see, you now have a stacked
bar chart that shows you two different colors One for the sales above the average
and one for the sales below the average To highlight more of the differences
we can set three reference lines The first reference line will set the average The second reference line will highlight
the results that are 20% more Than the sales average each month We will set a green color for this line And then add the expression to calculate the 20%
higher value The third reference line will highlight
the results that are 20% less Than the sales average each month In this case we are going to assign it a red color And then add the expression
to calculate the 20% lower value Then, you can customize the appearance of your bar chart In this case we are going to turn off show legend And turn on value labels instead Then, we add a title to the bar chart And in the Y-Axis we
are going to use the labels only option And here’s the result You now have a stacked bar chart That shows a different color for values that are above and
below the average To highlight the proportion between the two values You also have reference lines that show
the average across months As well as plus or minus 20% of the average And that concludes this video Thanks for watching! Oh
Oh

Add a Comment

Your email address will not be published. Required fields are marked *