You are currently viewing Power BI: Conditional Formatting based on String Value
Conditional Formatting based on string powerbi

Power BI: Conditional Formatting based on String Value

In this post, we will learn How to perform Conditional Formatting based on string value in Power BI that has been introduced on the Feb 2023 Power BI Feature Summary.

conditional formatting based on string value power bi
Conditional formatting based on string value Power BI

What’s Conditional Formatting in Power BI?

Conditional formatting is a feature in Power BI that allows you to change the appearance of data based on a set of conditions or rules.

Conditional Formatting in Power BI
Conditional Formatting in Power BI

This feature helps you to quickly identify trends, patterns, and anomalies in your data by highlighting specific values, cells, or columns that meet certain criteria.

With conditional formatting,

  • You can choose from a wide range of formatting options, such as font color, background color, font style, and data bars.
  • You can also use icons, such as arrows or circles, to represent different levels of data.
Conditional Formatting Rules in Power BI
Conditional Formatting Rules in Power BI

Conditional formatting is particularly useful when you need to visualize large amounts of data and want to highlight specific data points that are important or require attention.

It can be used in various types of visuals, including tables, charts, and matrices, and can help you to create more impactful and insightful reports and dashboards.

Conditional Formatting based on String Value in Power BI

Power BI Team released a new reporting feature related to Conditional Formatting in the Feb 2023 Power BI summary feature updates, which many customers have been asking about, that is you can simply create Conditional Formatting based on String value in Power BI now.

Conditional Formatting based on string value Power BI
Conditional Formatting based on string value Power BI

How to create Conditional Formatting based on String Value in Power BI?

Take the following scenario: you have a table that contains the names of departments such as IT, HR, and so on, and these values are displayed in a stacked column bar chart.

stacked column chart conditional formatting based on string

Now you need to perform a conditional formatting based on string value on the department column, and you need to do the following:

  • If the department name is equal IT, the column bar should be Red.
  • If the department name is equal HR, the column bar should be Green.
  • Otherwise, it should be the default color.

Currently, performing such a scenario and conditional formatting depending on string value is a piece of cake by doing the following:

Steps

  1. Click on your visual, then click on formatting button in the visualization pane
  2. Scroll down to “Columns“, then click on “Conditional Formatting” button as shown below.
Conditional Formatting in Power BI
Conditional Formatting in Power BI
  1. Once you click on “Conditional Formatting” button, a new dialog should be opened to perform your rules.
  2. Now, you can select department column, and add your rules on the string column as you prefer.
Conditional Formatting based on string column Power BI
Conditional Formatting based on string column Power BI

Besides the “IS” operators, you can also use the below operators that meet with the string values

Conditional Formatting operators Power BI
Conditional Formatting operators Power BI

Once you built your rules as your need, just click on “Ok” button, to apply the conditional formatting on your visual based on string value as shown below.

Conditional Formatting based on string column result
Conditional Formatting based on string column result

Conclusion

Conditional formatting in Power BI is a powerful feature that allows users to format their data visualizations based on certain criteria. By setting rules and conditions for formatting, users can easily highlight important data points and bring attention to areas that require further analysis.

Power BI offers a variety of options for conditional formatting, including data bars, color scales, and icons. Users can also create custom formatting rules using expressions and measures, providing flexibility and customization to their data visualization.

Overall, conditional formatting in Power BI is a valuable tool for enhancing data visualizations and making insights more accessible to users. By allowing users to highlight important data and customize their visualizations, conditional formatting helps users to better understand and analyze their data, leading to more informed decision-making.

In this post, we have introduced the new conditional formatting based on string column value and providing a real example for how to use it.

Download

See Also

Mohamed El-Qassas

I'm Microsoft MVP, SharePoint StackExchange Moderator, Microsoft QnA Moderator, C# Corner MVP, Microsoft TechNet Wiki Judge, and Senior Technical Consultant with +12 years of experience in SharePoint, Project Server and Power Platform.