Power BI – Gradient Legends

Last modified date

Introduction

When conditional formatting is applied to a visual it is important to make sure the reader of the report understands what the different colours on the report mean. Is purple good? Is orange ok? In the July 2020 update to Power BI Microsoft introduced a new feature of Gradient Legends to help annotate the colours used in a colour scale conditional formatting.

Gradient Legends

YouTube Version

YouTube image

Adding Conditional Formatting

turnover chart without conditional formatting

In this chart we have Turnover plotted for every month as a bar chart. The sales manager now wants to colour each bar based on the profit margin.

They select the chart and select the format section of the visualization pane. Under data colours they click the fx button next to the colour to open the conditional formatting dialog box.

conditional formatting dialog

Then the sales manager changes the field selected to the measure already setup of Profit Margin. They then can change the colours for the minimum and maximum values before pressing OK to apply the formatting.

chart with conditional formatting

View Legend

Not all visuals have the legend turned on by default. The legend can be turned on in the visualizations pane.

turn on legend
gradient legend

Changing Values in Gradient Legends

The min and max values will be calculated based on the data. These can be adjusted by returning to the conditional formatting dialog box, via visualizations pane and data colours and clicking on the fx button.

round numbers for the gradient legend

Then for the min and max values change from Auto to custom for the value and type in the values. If a plotted value is below the minimum it will be the minimum colour and the same is for maximum. In this example we have just gone to the nearest 5%.

2 value gradient legends

Adding a middle colour

A mid-way third colour can added to the colour scale and that will update the legend to match.

adding a third colour to gradient legends

Return back to the conditional formatting of the column colour and tick the diverging box. This will now add a third colour. After you click okay, the legend will now be updated to show all the values.

Chart with Gradient Legend

Conclusion

For those who use colour scale conditional formatting this is a great addition to make their story on the dashboard crystal clear. Adding gradient legends is crucial to annotate charts clearly.

Over 20 year experience at being passionate about training, solving problems and loving a new challenge especially in the Microsoft's Power Platform suite.