Conditional formatting of data labels

Data labels in charts are always useful because they implicitly show us the value of the series, without the need to look at the axis. However, in traditional charts, they are always formatted the same way; they are displayed in the same font size and style, the same color… Power BI Desktop recently got the option of conditional formatting of these values, which makes the reports much more vivid.

We will import a dataset with sales data, and then create a simple line chart visual. The names of the months are shown on the x-axis, and sales values on the y-axis. We will add data labels…

If you go to the Formatting menu and then expand the Data Labels section, you’ll see a submenu called Values. From the Color menu, we can easily choose the color with which the value labels will be displayed. However, since we want to apply conditional formatting, it is necessary to click on the fx button. After this action, a window for setting conditional formatting options will open.

In the Format Style drop-down list, it is necessary to select Rules, and then the measure based on which the values are generated. In our case, it is the SUM of KOL. Next we will set the rules as shown in the image.

After we confirm the action, data labels will appear formatted in accordance with the rules.