Power bi change color based on value [With 13 real examples]

In this Power BI Tutorial, we have learned about how to change color based on the value in Power BI with a few examples, and also we learned how we can change the color using DAX and Conditional Formatting.

  1. Power BI changes color based on the value
  2. Power BI changes color based on the value bar chart
  3. Power BI change background color based on the value
  4. Power BI changes card visual color based on the value
  5. Power BI changes cell color based on the value
  6. Power BI changes column color based on the value
  7. Power BI changes label color based on the value
  8. Power BI changes font color based on the value
  9. Power BI change background color based on the text value
  10. Power BI change marker color based on the value
  11. Power BI changes the row color based on the value
  12. Power BI change line color based on the value
  13. Power BI changes shape and color based on the value
  14. Power BI changes slicer color when filtered

Power BI change background color based on the value

Let us see how to change the background color based on the value for the selected visual chart in the Power BI,

  • Here, we use the slider to change the background color of the column chart in Power BI. When we slide the slicers if the sales value is less than 20000 the column bar displays a mild blue color.
  • If the sales value is greater than 20000 and less than 60000 then the column bar displays as Yellow color.
  • If the sales value is greater than 60000 and less than 150000 then the column bar displays brown color.

Follow the below-mentioned steps to change the background color in Power BI::

  • Select the column chart visual for which you want to change the background, the Format Visual under the Visualisation pane.
  • In the general settings, expand the effect and change the background color as shown below:
Power BI change background color based on the value
Power BI change background color based on the value
  • Here I have added the Sales Slicer, so when I slide the slicers, the background color of the column chart changes accordingly,
  • As shown in the below screenshot, select the Format style as Gradient and choose the column field value, Either we can add a custom value in the Enter a value field or We can leave the values by default, lowest value, Middle value, and Highest Value.
  • In the example, I am going to choose the custom option and enter the custom values, Click on the Ok button to display the column chart based on the value.
how to change background color based on the value
how to change background color based on the value
  • In the below screenshot, we can see that the background color changes based on the Values that we slider on the sales slicers.
how to change background color based on the value example
how to change background color based on the value example

This is how we change the background color based on the value for the selected visual chart in the Power BI.

Power BI changes color based on the value bar chart

Let us see how to change the color based on the value in the bar chart in Power BI,

  • In this example, we use a stacked column bar chart to see the sales that occurred based on the Product Name.
  • Here if the sales occurred less than 20000 then the column bar chart displays in the Purple color.
  • If the sales value is greater than 20000 and less than 100000 then the column bar displays a sky blue color.
  • If the sales value is greater than 100000 and less than 150000 then the column bar displays pink color.

Follow the below-mentioned steps to change the bar color in Power BI: :

  • Initially, make sure the source data has been loaded to the Power BI desktop.
  • Now under the Visualizations pane, click on the stacked column chart option, you can see that the stacked column chart is added to the report canvas and resize it.
  • For that in the X-axis field drag and drop the Product Name field. And in the Y-axis field drag and drop the sales field.
Power BI changes color based on the value bar chart
Power BI changes color based on the value bar chart
  • Select the Format Visual under the Visualisation pane, Expand Columns under the Visual tab (highlighted in Red), and click on the Fx icon as shown below:
Power BI change color based on the value bar chart
Power BI changes color based on the value bar chart
  • Now, Select the Format style as Gradient and choose the column field value, Either we can add a custom value in the Enter a value field or We can leave the values by default, lowest value, Middle value, and Highest Value.
  • In the example, I am going to choose the custom option and enter the custom values as shown below: Click on the Ok button to display the column chart based on the value.
Power BI change color based on the value bar chart example
Power BI changes color based on the value bar chart example
  • The screenshot below shows that the Column chart color has been changed based on the sales Values that we applied in the condition.
Power BI changes color based on the value bar chart example
Power BI changes color based on the value bar chart example

This is how to change the color based on the value in the bar chart Power BI.

Power BI changes card visual color based on the value

Let us see how we can change the Power BI card’s visual color based on the value,

  • In this example, we will use the list slicer to change the card’s visual color based on the value.
  • If the sales value is greater than or equal to 100 and less than or equal to 90000 then the card value color changes to sky blue.
  • If the sales value is greater than or equal to 90000 and less than or equal to 130000 then the card value color changes to Purple.

Follow the below steps to change the card color value in Power BI:

  • Initially, add the list slicer and card visual to the Power BI report canvas.
  • For that Initially, create a list slicer and make a list slicer and drag the Sales field column into that as shown below:
change card visual color based on the value in Power BI
change card visual color based on the value in Power BI
  • In the Visualizations pane, select the card icon to create a card, and add the Sales field to it like below:
change card visual color based on the value in the Power BI
change card visual color based on the value in the Power BI
  • Select the Format Visual under the Visualisation pane, Expand the Callout value under the Visual tab (highlighted in Red), and click on the Fx icon as shown below:
how to change card visual color based on the value
how to change card visual color based on the value
  • Now, Select the Format style as Rules and choose the column field value, Now add the rule that you want to apply. Select +New rule to add a new rule condition.
  • Here, If the Sales value is greater than or equal to the minimum value and less than the maximum value then it displays the data card value accordingly.
  • Click on the Ok button to display the card visual based on the condition applied.
change card visual color based on value in the Power BI
change card visual color based on the value in the Power BI
  • Now, we can see that the card visual data color changes according to the selected list slicer value as below: If we select the value less than 90000 then the card visual data color changes to a sky blue color.
change card visual color based on value in the Power BI example
change card visual color based on the value in the Power BI example
  • If we select the value greater than 90000 then the card visual data color changes to purple color.
change card visual color based on value in the Power BI
change card visual color based on value in the Power BI

This is how to change the card’s visual color based on the value in power bi.

Power BI changes cell color based on the value

Let us see how we can change the cell color based on the value in the Power BI,

In this example, I have added three columns to the table, they are Product Name, Sales, and Profit.

  • Here, If the sales value is greater than or equal to 100 and less than or equal to 70000 then the table cell value color changes to mild blue.
  • If the sales value is greater than or equal to 70000 and less than or equal to 125000 then the card value color changes to Yellow.
  • If the sales value is greater than 125000 then the table cell value color changes to sky blue.

Follow the below steps to change the table cell color in Power BI:

  • Initially add the table visual to the Power BI report canvas, and add the columns in the column field which you want to display in the table.
Power BI changes cell color based on the value
Power BI changes cell color based on the value
  • Select the Format Visual under the Visualization pane, Expand Cell Elements under the Visual tab (highlighted in Red):
  • Now, Select the column Under the series in the Apply setting to opt for which you want to change the cell color.
  • Enable the background color and click on the Fx icon as shown below:
Power BI change cell color based on the value
Power BI changes cell color based on the value
  • Once the background color is enabled, it automatically redirects to the conditional formatting page.
  • Select the Format style as Gradient and choose the column field value, Either we can add a custom value in the Enter a value field or We can leave the values by default, lowest value, Middle value, and Highest Value.
  • In the example, I am going to choose the custom option and enter the custom values, Click on the Ok button to display the cells in a color based on the value applied.
Power BI change cell color based on the value example
Power BI changes cell color based on the value example
  • In the below screenshot, we can see that the table cell color changes based on the Values or conditions applied.
how to change cell color based on the value in Power BI
how to change cell color based on the value in Power BI

This is how to change the cell color based on the value in the Power BI.

Power BI changes column color based on the value

Let us see how we can change the column color based on the value in Power BI,

  • In this example, we will change the column color based on the sales count that occurred by product.
  • If the product count is greater than 2 and less than 4 then the column color changes to a mild blue color.
  • If the product count is greater than 4 and less than 6 then the column color changes to a Yellow color.
  • If the product count is greater than 6 then the column color changes to a sky blue.

Follow the below steps to change the column color in Power BI:

  • Initially add the column chart visual to the Power BI report canvas, in the X-axis field drag and drop the Product Name field. And in the Y-axis field drag and drop the sales field.
  • In the example, we will see the sales count based on the Product Name.
Power BI changes column color based on the value
Power BI changes column color based on the value
  • Select the Format Visual under the Visualisation pane, Expand Columns under the Visual tab (highlighted in Red), and click on the Fx icon as shown below:
Power BI change column color based on the value
Power BI changes data color based on the value
  • Now, Select the Format style as Gradient and choose the column field value, Either we can add a custom value in the Enter a value field or We can leave the values by default, lowest value, Middle value, and Highest Value.
  • In the example, I am going to choose the custom option and enter the custom values based on the count of sales.
  • Click on the Ok button to display the column chart based on the value.
Power BI change column color based on the value example
Power BI changes column color based on the value example
  • The screenshot below shows that the Column chart color has been changed based on the Values.
Power BI changes column color based on the value example
Power BI changes column color based on the value example

This is how to change the column color based on the value in Power BI.

Power BI changes data label color based on the value

Let us see how to change the data label color based on the value in Power BI,

  • In this example, we will change the data label color based on the sales occurred by product.
  • If the sales value is greater than 100 and less than 30000 then the data label color displays as Pink color.
  • If the sales value is greater than 30000 and less than 150000 then the column bar displays Blue color.

Follow the below steps to change the data label color in Power BI:

  • Initially, add the list slicer and card visual to the Power BI report canvas.
  • In this example, we will use the list slicer, For that Initially, create a slicer and make a list slicer and drag the Sales field column into that as shown below:
Power BI changes label color based on the value
Power BI changes label color based on the value
  • In the Visualizations pane, select the Stacked bar chart, and add the Sales field to the X-axis field and the Product Name in the Y-axis field as shown below:
Power BI changes label color based on value
Power BI changes label color based on the value
  • Select the Format Visual under the Visualisation pane, Enable the Data label option, and Expand the options to choose the position like the inside end, outside end, inside the center, and inside base under the Visual ta.
  • And expand the values and click on the Fx icon as shown below:
Power BI changes label color based on the value example
Power BI changes label color based on the value example
  • Now, Select the Format style as Rules and choose the column field value, Now add the rule that you want to apply. Select +New rule to add a new rule condition.
  • Here, If the Sales value is greater than or equal to the minimum value and less than the maximum value then it displays the data card value accordingly.
  • Click on the Ok button to display the card visual based on the condition applied.
Power BI changes label color based on value example
Power BI changes label color based on value example
  • Now, we can see that the data label value color changes according to the selected list slicer value as below: If we select the value less than 30000 then the data label color changes to Pink color.
Power BI changes data label color based on value example
Power BI changes data label color based on value example
  • If we select the value greater than 30000 then the data label color changes to sky blue color.
Power BI change label color based on value example
Power BI changes label color based on value example

This is how to change the data label color based on the value in Power BI.

Read Power BI calculated column

Power BI changes font color based on the value

Let us see how to change the font color based on the value in Power BI,

  • Initially, select the Matrix visual, in the row field drag and drop the Product Name and in the values field simply drag and drop the Sales field.
Power BI changes font color based on the value
Power BI changes font color based on the value
  • Select the Format Visual under the Visualisation pane, Expand Cell Elements under the Visual tab (highlighted in Red):
  • Enable the font color and click on the Fx icon as shown below:
Power BI changes font color based on value
Power BI changes font color based on the value
  • Before that, create a measure and apply the below-mentioned formula, and apply the measure in the conditional formatting that I have explained below:
Measure = SWITCH ( TRUE (),  
SUM(Sales_Table[Sales])>130000,"yellow", 
SUM(Sales_Table[Sales]) > 70000,"Pink",                                                                                                              SUM(Sales_Table[Sales]) > 300000,"Red",                                                                                                            SUM(Sales_Table[Sales]) < 20000,"Pink", 
    "Red" 
) 
how to change font color based on value example
how to change font color based on value example
  • Now in the conditional formatting for background color, select the Format by as Field value, select the Apply to as Value only and select the measure we have created. Click on OK. 
how to change font color based on the value
how to change font color based on the value
  • In the below screenshot, you can see that the font color has been changed based on the value.
how to change font color based on value
how to change font color based on the value

This is how to change the font color based on the value in Power BI.

Read Power BI sync slicers

Power BI change background color based on the text value

Let us see how we can change the background color based on the text value in Power BI,

  • Select the Table visual, In the column field drag and drop the sales and product name field as shown below:
Power BI change background color based on the text value
Power BI change background color based on the text value
  • Select the Format Visual under the Visualisation pane, Expand Cell Elements under the Visual tab (highlighted in Red):
  • Enable the background color and click on the Fx icon as shown below:
Power BI change background color based on text value
Power BI change background color based on the text value
  • Before that, create a measure and apply the below-mentioned formula, and apply the measure in the conditional formatting that I have explained below:
Measure2 = 
VAR a = IF(SELECTEDVALUE('Sales_Table'[Product Name]) = "Desktop", True, False)
VAR b = IF(SELECTEDVALUE('Sales_Table'[Product Name]) = "Laptop", True, False)
VAR c = IF(SELECTEDVALUE('Sales_Table'[Product Name]) = "TV", True, False)

RETURN

SWITCH(
TRUE(),
a , "Blue",
b, "Red",
c, "Yellow")
Power BI changes color based on the value Dax
Power BI changes color based on the value Dax
  • Now in the conditional formatting for background color, select the Format by as Field value, select the Apply to as Value only and select the measure we have created. Click on OK.
Power BI changes color based on value Dax
Power BI changes color based on value Dax
  • The screenshot below shows that the text color has been changed based on the value.
Power BI changes color based on value Dax example
Power BI changes color based on the value of Dax’s example

This is how we can change the background color based on the text value in Power BI.

Read Line Chart in Power BI

Power BI change marker color based on the value

Let us see how we can change marker color based on the value on the Power BI line chart,

There is no direct way to apply conditional formatting on the Power BI to change the Marker color. But, there is an alternative that we can achieve this. Follow the below-mentioned steps:

  • Make sure the source data has been loaded to the Power BI desktop.
  • Now under the Visualizations pane, click on the stacked column chart option, you can see that the stacked column chart is added to the report canvas and resize it.
  • In this example, we use a stacked column chart to see the sales that occurred based on the Product, for that in the X-axis field drag and drop the Product Name field. And in the Y-axis field drag and drop the sales field.
Power BI change marker color based on the value
Power BI change marker color based on the value
  • Select Format Visual under the Visualisation pane, Expand the Columns under the Visual tab (highlighted in Red), and click on the Fx icon as shown below:
  • We cannot apply conditional formatting in the line chart, because we cannot see the fx icon option in the line chart format visuals.
Power BI change marker color based on value
Power BI change marker color based on the value
  • Now, Select the Format style as Gradient and choose the column field value, Either we can add a custom value in the Enter a value field or We can leave the values by default, lowest value, Middle value, and Highest Value.
  • Click on the Ok button to apply the conditional formatting for the column chart.
how to change marker color based on value in the Power BI
how to change marker color based on the value in the Power BI
  • The screenshot below shows that the Column chart has been formatted based on the Values.
how to change marker color based on value in Power BI
how to change marker color based on the value in Power BI
  • Now under the Visualizations pane, change the stacked column chart visual to the Line Chart visual. Now we can see the expected output as shown below:
how to change marker color based on value in the Power BI example
how to change marker color based on the value in the Power BI example

This is how we can change marker color based on the value on the Power BI line chart.

Read Power BI Group By

Power BI changes the row color based on the value

  • It is not possible to change the color of the row based on the value.
  • Currently Power BI does not have the features to change the background color for the entire row in a Table or in a Matrix.
  • Only we can create a measure and use conditional formatting to change the field values based on the applied condition.

Power BI change line color based on the value

Let us see how we can change the line color based on the value in Power BI,

  • Select the Line visual, In the x-axis field drag and drop the date field and in the Y-axis drag and drop the Sales field as shown below:
Power BI change line color based on the value
Power BI change line color based on the value
  • We cannot apply conditional formatting in the line chart, because we cannot see the fx icon option in the line chart format visuals.
  • So we have to create a measure and apply the condition to it.
  • In this example, totally I have created 5 measures. to calculate the First Sale, Last Sale, Total Sale, and Sale 1 and Sale 2 to differentiate the line color.
  • First, we will calculate the Total Sale Value, for that create a measure, and apply the below-mentioned formula,
Total Sales = SUM(Sales_Table[Sales])
  • To calculate the First Sales Value, create a measure, and apply the below-mentioned formula
First Sales = CALCULATE(FIRSTNONBLANKVALUE(Sales_Table[Order Date].[Month], [Total Sales]), ALLSELECTED(Sales_Table))
  • To calculate the Last Sales Value, create a measure, and apply the below-mentioned formula
Last Sales = CALCULATE(LASTNONBLANKVALUE(Sales_Table[Order Date].[Month], [Total Sales]), ALLSELECTED(Sales_Table))
  • In the same way, to differentiate the line color, create a measure, and apply the below-mentioned formula
Sales1 = IF([Last Sales]<[First Sales], [Total Sales], BLANK())
  • In the same manner, to differentiate the line color, create another measure, and apply the below-mentioned formula
Sales2 = IF([First Sales]>=[Last Sales], [Total Sales], BLANK())
  • Now, select the line chart In the Y-axis field remove the sales field and simply drag and drop the Sales1 and Sales2 measures that we created to differentiate the line color.
Power BI change line color based on the value example
Power BI change line color based on the value example
  • Select the Format Visual under the Visualisation pane, Expand Lines under the Visual tab (highlighted in Red) and choose the color that you want to display as shown below:
Power BI change line color based on value example
Power BI change line color based on value example
  • The below screenshot represents that If you select Sales 1 then it displays the line color as blue, If you select the Sales2 then it displays the line color as Purple.
Power BI change line color based on value
Power BI change line color based on the value

This is how to change the line color based on the value in Power BI.

Read Power bi conditional column

Power BI changes shape and color based on the value

Let us see how we can change the shape and color based on the Value,

  • Initially, insert the shape into the Power BI report canvas as shown below: Select the insert icon and In the Shapes section, choose the shape that you want to display in the report canvas.
Power BI changes shape color based on the value
Power BI changes shape and color based on the value
  • Select the Format Visual under the Visualisation pane, Expand Style to enable the fill option, and click on the Fx icon as shown below:
Power BI change shape color based on the value
Power BI changes shape and color based on the value
  • Before that, Create a measure and apply the below-mentioned formula, and apply the measure in the conditional formatting that I have explained below:
Measure = SWITCH ( TRUE (),  
SUM(Sales_Table[Sales])>130000,"yellow", 
SUM(Sales_Table[Sales]) > 70000,"Blue",                                                                                                              SUM(Sales_Table[Sales]) > 300000,"Red",                                                                                                            SUM(Sales_Table[Sales]) < 20000,"Green", 
    "Pink" 
) 
  • Now in the conditional formatting for background color, select the Format by as Field value, select the Apply to as Value only and select the measure we have created. Click on OK. 
Power BI change shape color based on value
Power BI changes shape and color based on the value
  • Add the list slicer to the Power Bi canvas, and drag and drop the Sales column fields into it. So based on the Sales value we select from the slicer, the shape and color will change according to the created measure.
Power BI changes shape color based on value
Power BI changes shape and color based on the value
  • In the below screenshot, you can see that the shape color has been changed based on the value in Power BI.
Power BI changes shape color based on value examplePower BI changes shape color based on value example
Power BI changes shape color based on value example

This is how to change the shape and color based on the value in Power BI.

Read Power BI date hierarchy

Power BI changes slicer color when filtered

Let us see how we can change the color of the slicer when filtered in Power BI,

  • If we are using many slicers in a single Power BI report canvas, in that case, we can see which slicer is filtered based on the slicer heading color.
  • Initially, add the drop slicer and the list slicer to the report canvas, In the dropdown slicer, add the product name field and in the list slicer, add the Sales field as shown below:
Power BI changes slicer color when filtered
Power BI changes slicer color when filtered
  • Now create a New measure and apply the below formula, In this example, we will see if we filter any product from the product name then the Sales Value heading will be Green, if not it displays the Red Color.
Measure 2 = IF(ISFILTERED(Sales_Table[Product Name]),"Green","Red")
  • Here, Select the Sales Slice, in the format visual pane, Under the slicer header, select the font color and click on the fx icon (highlighted in red below):
slicer color when filtered in Power BI
slicer color when filtered in Power BI
  • Now in the conditional formatting for background color, select the Format by as Field value, select the Apply to as Value only and select the measure we have created. Click on OK. 
slicer color when filtered in the Power BI
slicer color when filtered in the Power BI
  • In the below screenshot, you can see that we didn’t filter any product name from the product slicer so the Sales heading is displayed in Red color based on the condition:
slicer color when filtered in the Power BI example
slicer color when filtered in the Power BI example
  • In the below screenshot, you can see that we selected the product name as Desktop from the product slicer so the Sales heading is displayed in Green color based on the condition:
slicer color when filtered in Power BI example
slicer color when filtered in Power BI example

This is how to change the color of the slicer when filtered in Power BI.

You may like the following Power BI tutorials:

In this Power BI Tutorial, we have learned about how to change the color based on the value with a few examples, and also we learned how we can change the color using DAX and Conditional Formatting. Also covered the below-mentioned topics:

  • Power BI changes color based on the value bar chart
  • Power BI change background color based on the value
  • Power BI changes card visual color based on the value
  • Power BI changes cell color based on the value
  • Power BI changes column color based on the value
  • Power BI changes label color based on the value
  • Power BI changes font color based on the value
  • Power BI change background color based on the text value
  • Power BI change marker color based on the value
  • Power BI changes the row color based on the value
  • Power BI change line color based on the value
  • Power BI changes shape and color based on the value
  • Power BI changes slicer color when filtered
>