Forum Discussion

viswaaa's avatar
viswaaa
Helper IV
11 months ago
Solved

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 t...
  • v-veshwara-msft's avatar
    11 months ago

    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.

     

     

    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.