Power BI Bar Chart Conditional Formatting

Do you know that Power BI Bar chart conditional formatting means changing the bar’s color based on value? Yes, this is right. Applying the Power BI conditional formatting feature can take your reports to the next level.

This article will show you how to change the bar’s color and Power BI bar chart color based on the value. Also, I will tell you about the Power BI bar chart color by category.

Power BI Condition Formatting bar chart

The first image displays a Power BI Bar chart with no bar color in a Power BI report. I want to change the Bar chart Bar color with various colors based on some conditions.

After applying the conditional formatting, the Bar chart will display with color bars, as shown in the second image.

Power BI Conditional Formatting Bar Chart

I have a SharePoint list (Finance Sample) that contains below columns with various data types:

ColumnsData Types
CountrySingle line of text
ProductSingle line of text
Discount BandSingle line of text
Units SoldNumber
ManufacturingNumber
Sale PriceCurrency
Gross SalesCurrency
SalesCurrency
power bi bar chart conditional formatting multiple values

I hope you open Power BI Desktop and load the data set in the Power BI. If you are new to Power BI, you can read an article about Create a Report from SharePoint List in Power BI.

1. I created a Power BI bar chart displaying the “Sum of Sales by Country.” The Y-axis contains the “Country,” and the X-axis contains the “Sum of Sales.”

Power BI bar chart color based on value

2. Now we apply conditional formatting for bars in Power BI

  1. Go to “Format your visual” Below the Visualisation navigation.
  2. Click on Visual format.
  3. Expand Bars under the Visual tab.
  4. Expand the Colors option.
  5. Click on the fx icon. Check the screenshot below.
Example for Power BI bar chart color based on the value

3. Now, it will open a conditional formatting page where we add color based on the value.

  1. Choose the Format style as “Rules”.
  2. Choose the column field value. In my case, “Sum of Sales.”
  3. Add +New rule.
  4. Now, put the minimum value, maximum value, and color.
  5. Then click “OK”. Check the screenshot below.
Power BI changes the color of the bar chart

4. After that, our bar chart color changed based on value.

Power BI bar chart conditional formatting

In this way, we can change the color of the bar chart by using Power BI bar chart conditional formatting.

Power BI Bar Chart Color by Category

In Power BI, the Bar Chart Color by Category feature allows you to assign different colors to the bars in a bar chart based on the categories in your data.

The first image displays a Power BI Bar chart without changing the color. After applying Power BI Bar Chart Color by Category, the Bar chart will display with color bars, as shown in the second image

Power BI Bar Chart Color by Category

I have a SharePoint list (Amazongo) used in this example.

ColumnsData Types
Order DateDate and time
Customer NameSingle line of text
StateSingle line of text
Product NameSingle line of text
CategorySingle line of text
Sub-CategorySingle line of text
SalesCurrency
ProfitCurrency
power bi conditional formatting bar chart based on field value

In this table visual, we have a product list. The product is divided into different categories and the products have their sales.

Power BI bar chart conditional formatting example

Using the data set, we create a bar chart that shows bar Color by “Category” in Power BI.

1. First, we create a bar chart that displays the “Sum of Sales by Product Name.” The Y-axis contains “Product Name,” and the X-axis contains “Sum of Sales.”

Power BI bar chart color by category

2. Now we apply condition formatting to the bar chart:-

  • Click on Format your visual -> Visual -> Bars
  • Expand the Colors option and click on the fx icon.
Example for Power BI bar chart color based on the value

3. It will open a condition formatting page where you:-

  1. Choose Format style ->Rules.
  2. Choose the column field value -> First Category.
  3. Add +New rule.
  4. Apply your rule, like if value Office Supplies, then color.
  5. Click on “OK.”
Changing Data Color for a bar chart Power BI

3. Now, you see the bar color change based on category.

Create Bar Chart with Colour Formatting

Here, we are creating the bar chart color by category, but it’s difficult to say which color is in which category.

To solve this problem, add the “Category” into the Tooltips Below the Visualisations pane. Then, hover over the bar, and you can see the “Category” in the dialog box.

Power BI bar chart color by category example

Using this process, we can create the Power BI Bar chart color by category.

Conclusion

Now you know that Power BI bar chart conditional formatting means changing the bar’s color based on the values.

This tutorial taught us how to apply conditional formatting on bar charts based on the value in a Power BI bar chart and Power BI Bar chart color by category.

You may also like: