How to Apply Conditional Formatting in Power BI Gauge Chart?

Do you want to learn how to apply conditional formatting in Power BI Gauge chart? Well, no worries!

In this Power BI tutorial, we will see how to format the gauge chart in Power BI conditionally like:

  • Conditional formatting in Power BI gauge chart based on the target
  • Power BI gauge chart conditional formatting percentage
  • Power BI gauge Conditional formatting based on field value
  • How to change the background color to the gauge chart

How to Apply Conditional Formatting in Power BI Gauge Chart

For example, we will use the Leads table and format the color based on the lead value in the Power BI gauge.

power bi gauge color gradient

Suppose the minimum lead value is 2000 and the maximum value is 5000. In that case, the fill color will transition from orange for lower lead values to dark yellow for higher leads, with shades in between reflecting varying lead values.

power bi gauge visual conditional formatting

Follow the below steps to apply conditional formatting in the Power BI gauge chart.

  • In Power BI Desktop, load the data using the get data option.
  • Then, select the gauge chart from the visualization pane.
  • Then, drag and drop the Lead value in the Value field.
power bi gauge conditional formatting
  • Now select the visual, and then click on the Format pane, expand the Color section.
  • Then, next to the Fill color, click fx to apply conditional formatting in the gauge chart.
power bi gauge conditional color

Now conditional formatting for the Fill colors window will open. Provide the information below.

  • Select the Format style as a Gradient.
  • Select the Lead value field in ‘What field should we base this on‘,
  • Select Sum as Summarization.
  • Next, ‘How should we format empty values‘ as ‘As zero‘.
  • Then, in Minimum value, select Custom from the dropdown and enter 2000. Select the color.
  • For the Maximum value, select Custom from the dropdown and enter the value as 5000
  • Also, you can enable the middle value by checking the box to add a middle color. Then click on OK.
conditional formatting gauge power bi

Now, you can see the conditional formatting is applied to the gauge chart.

power bi gauge chart conditional formatting

Now add one Lead source Slicer visual. Filter the gauge chart; the color will change based on the value.

power bi gauge color

This is an example of Power BI gauge chart conditional formatting.

Power BI gauge conditional formatting based on the target

Here, we will see how to apply conditional formatting to the Power BI gauge based on the target value.

See also  Save Office 365 Email Attachments to OneDrive for business using Power Automate

In this example, we will use the same Leads table and conditionally format the gauge chart’s color based on the target value.

In this scenario, the fill color will transition from pink for lower target values to shades of orange for values approaching the maximum sales target of 8000. The transition will include a midpoint color reflecting the middle value of 5000.

Power BI gauges conditional formatting based on the target

Follow the below steps to apply conditional formatting in the Power BI gauge chart.

  • In Power BI Desktop, load the data using the get data option.
  • Then, select the gauge chart from the visualization pane.
  • Then, drag and drop the Lead and target values to the Value and target fields.
power bi gauge conditional formatting based on target
  • Now select the visual, and then click on the Format pane, expand the Color section.
  • Then, next to the Fill color, click fx to apply conditional formatting in the gauge chart.
Power bi gauge conditional formatting based on target value

Now conditional formatting for the Fill colors window will open. Provide the information below.

  • Select the Format style as a Gradient.
  • Select the Target value field in ‘What field should we base this on‘.
  • Select Sum as Summarization.
  • Next, ‘How should we format empty values‘ as ‘As zero‘.
  • Then, in Minimum value, select Custom from the dropdown and enter 2000. Select the color.
  • For the Maximum value, select Custom from the dropdown and enter 8000. Then, select the color.
  • Also, you can enable the middle value by checking the box to add a middle color. Set the custom value as 5000 Then click on OK.
gauge conditional formatting power bi
  • You can see that conditional formatting is applied to the gauge chart based on the target value.
  • Now, if you filter the gauge chart by using the Lead source slicer, you can see below. Based on the target value, the color will change in the Power BI gauge chart.
power bi gauge color conditional formatting

This is an example of conditional formatting based on the target in the Power BI gauge.

Power BI gauge conditional formatting percentage

Here, we will see how to apply conditional formatting to the Power BI gauge chart based on percentage.

In this example, we will use the Leads table to create a gauge chart. Then, we will apply the conditional formatting based on the ‘Target achievement percentage.’

power bi gauge change color based on value

As you can see below, the target achievement percentage calculates the percentage of the target achieved from the given leads target.

% of Target = 
    DIVIDE (
        SUM(Leads[Lead Value]),
        SUM(Leads[Target Value])
    )

Follow the below steps to apply conditional formatting on the Power BI gauge chart based on percentage.

  • In Power BI Desktop, load the data using the get data option.
  • Then, select the gauge chart from the visualization pane.
  • Then, drag and drop the % of the target measure to the Value field.
conditional formatting power bi gauge
  • Now select the visual, and then click on the Format pane, expand the Color section.
  • Next to the Fill color, click fx to apply conditional formatting in the gauge chart.
how to change gauge color in power bi

Now conditional formatting for the Fill colors window will open. Provide the information below.

  • Select the Format style as a Gradient.
  • Select the ‘% of target’ field in ‘What field should we base this on. ‘
  • Select Sum as Summarization.
  • Next, ‘How should we format empty values‘ as ‘As zero‘.
  • Then, in Minimum value, select Custom from the dropdown and enter 0.5. Select the color.
  • For the Maximum value, select Custom from the dropdown and enter the value as 1.
  • Also, you can enable the middle value by checking the box to add a middle color. Then click on OK.
change gauge color power bi

Now, you can see conditional formatting is applied to the gauge chart based on the percentage value.

See also  How to Remove Duplicates in Power Apps Dropdown

Using the Lead source slicer we are filtering the gauge chart in Power BI.

power bi gauge color based on target

This is an example of conditional formatting percentage in the Power BI gauge.

Power BI gauge changes color based on field value

Here, we will see how to change the color of the Power BI gauge chart based on the value.

In this example, we will use the Leads table to create a gauge chart. Then, we will dynamically add color to the gauge chart; if the lead value is greater than the target value, the color will change to green. Otherwise, it will be red.

Power BI gauge chart color based on field value

For this follow the below steps to change gauge color based on Field value.

  • In Power BI Desktop, click on the Gauge chart from the visualization pane.
  • Then, drag and drop the Lead value and Target value to the Value and Target value field.
Power BI gauges change color based on value

Next, we will create a measure; for this, click on New Measure. Then, write the formula below in the Formula box.

Color = IF(SUM(Leads[Lead Value])>SUM(Leads[Target Value]),"Green","Red")
Power BI gauges change color based on field value
  • Now, click on the Format pane, then expand the Colors section.
  • Next to the Fill color, click fx to apply conditional formatting in the gauge chart.
Power BI gauge change color based on field value

Now conditional formatting for the Fill colors window will open. Provide the information below.

  • Select the Format style as a Field value.
  • Under ‘What field should we base this on?’, select the Color measure from the table. Then click on OK.
Power BI gauge color based on field value

Now you can see the gauge fill color change to green because the lead value is greater than the target value in Power BI.

Power BI gauge chart color based on field value

This is an example of a Power BI gauge that changes color based on field value.

See also  How to merge arrays in Power Automate?

Power BI gauge background color

Here, we will see how to change the background color of the gauge chart.

For example, we will use the Leads table to create the gauge chart in Power BI. We will change the color of the gauge background, not the widget background.

The Power BI Formatting pane does not have an option to change the background color of the Power BI gauge visual. So, we will use the theme functionality to change the background color of the Power BI gauge chart.

Power BI gauge background color

Follow the below steps to change the background color of the Power BI gauge chart.

  • Open Power BI Desktop and load the data using the Get Data option.
  • To create the gauge chart, select the gauge chart from the visualization pane.
  • Then, drag and drop the Lead value and Target value to the Value and Target value field.
Power BI gauge chart background color

To change the color of the background, click on the view tab, then click on the Themes dropdown. Click on Customize current theme.

Power BI gauge chart change background color

Next, click on the Name and Colors, select Advanced, and then change the color of the Third-level element. Click on Apply.

Power BI gauge change background color

Now you can see the Power BI gauge chart background color is changed to Orange.

Power BI gauge visual change background color

This is how to change the background color of the Power BI gauge chart.

Additionally, you may also like:

Conclusion

In this Power BI tutorial, we saw how to apply conditional formatting in the Power BI gauge chart.

Also, we have covered the topics below:

  • Power BI gauges conditional formatting based on the target
  • Power BI gauge conditional formatting percentage
  • Power BI gauge changes color based on field value
  • Power BI gauge background color
>