Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
viswaaa
Helper IV
Helper IV

Conditional color chart based on value

Hi All,

 

I need to build a chart which shows % of sales for a country.

I have India country and % of sales 14 % .These are direct columns.

 

Now I need a chart which shows a needle like below to show % of sales and should be color code also as red.

If its morethan 70 should be green .But the chart I am using doesnt have the conditional color code.(Tachometer chart)

 

Please suggst the chart to fit my requirement or the steps create the required chart

 

viswaaa_0-1756805796562.png

 

 

1 ACCEPTED SOLUTION
v-veshwara-msft
Community Support
Community Support

Hi @viswaaa ,

Thanks for posting in Microsoft Fabric Community.

Thanks to @Shahid12523 , @alish_b  and @MohamedFowzan1 for your valuable suggestions.

 

I tested this scenario using a small table with Country and SalesPct values. For example, India = 14, USA = 72, UK = 45, Germany = 85. In the gauge visual, I placed SalesPct as the Value and fixed the axis from 0 to 100. With a country slicer applied, the colors update based on the classification.

To classify performance I used a measure such as:

Sales Performance = 
SWITCH (
    TRUE(),
    MAX('Sales'[SalesPct]) >= 70, 1,   // Good (Green)
    MAX('Sales'[SalesPct]) >= 50, 2,   // Fair (Yellow)
    3                                  // Poor (Red)
)

This allows you to define whether the percentage should be treated as red or green.

vveshwaramsft_0-1756884660311.pngvveshwaramsft_1-1756884677984.png

 

 

If this approach does not meet your exact need, you can consider custom visuals such as xViz Advanced Gauge or Dial Gauge, which have semantic formatting options to apply red or green automatically as suggested in the blog link already shared earlier by @MohamedFowzan1 

 

 

Hope this helps. Please reach out for further assistance.

Thank you.
Attached .pbix file for reference.

 

 

 

 

View solution in original post

4 REPLIES 4
v-veshwara-msft
Community Support
Community Support

Hi @viswaaa ,

Thanks for posting in Microsoft Fabric Community.

Thanks to @Shahid12523 , @alish_b  and @MohamedFowzan1 for your valuable suggestions.

 

I tested this scenario using a small table with Country and SalesPct values. For example, India = 14, USA = 72, UK = 45, Germany = 85. In the gauge visual, I placed SalesPct as the Value and fixed the axis from 0 to 100. With a country slicer applied, the colors update based on the classification.

To classify performance I used a measure such as:

Sales Performance = 
SWITCH (
    TRUE(),
    MAX('Sales'[SalesPct]) >= 70, 1,   // Good (Green)
    MAX('Sales'[SalesPct]) >= 50, 2,   // Fair (Yellow)
    3                                  // Poor (Red)
)

This allows you to define whether the percentage should be treated as red or green.

vveshwaramsft_0-1756884660311.pngvveshwaramsft_1-1756884677984.png

 

 

If this approach does not meet your exact need, you can consider custom visuals such as xViz Advanced Gauge or Dial Gauge, which have semantic formatting options to apply red or green automatically as suggested in the blog link already shared earlier by @MohamedFowzan1 

 

 

Hope this helps. Please reach out for further assistance.

Thank you.
Attached .pbix file for reference.

 

 

 

 

MohamedFowzan1
Solution Specialist
Solution Specialist

Hi @viswaaa 

 

I believe this should help you out:
https://blog.coupler.io/power-bi-gauge/

 

alish_b
Super User
Super User

Hey @viswaaa ,

If you are planning to show this kind of comparison for more than one country, bullet chart might be worth exploring. It will work for just one country as well but it really shines when you are dealing with multiple categories. Find a detailed documentation on bullet charts in Power BI here: https://www.sqlbi.com/articles/building-bullet-charts-in-power-bi-reports/

Hope it helps!

 

Shahid12523
Community Champion
Community Champion

Option 1: Use Power BI Gauge Chart

The built-in Gauge visual doesn’t have direct conditional color formatting, but you can achieve it like this:

Add your % of sales measure (e.g., Sales % = DIVIDE([Sales], [Total Sales])).

Place it in the Gauge Value.

In the Format pane → Data colors, Power BI won’t allow conditions directly, but you can:

Create another measure that sets thresholds:

GaugeColor =
IF([Sales %] < 0.7, "Red", "Green")


Use a custom visual (see below), because native gauge won’t let you bind GaugeColor.

 

Option 2: Use Custom Visual (Bullet Chart / Tachometer Pro / Shielded Gauge)

Go to Power BI Visuals Marketplace (AppSource) and search:

“KPI Tachometer”

“Bullet Chart by OKViz”

“Dial Gauge”

“xViz Gauge”

Most of these allow conditional formatting (rule-based colors for ranges, e.g., 0–70 Red, 70–100 Green).

Shahed Shaikh

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.