Forum Discussion

i_stanescu_ro's avatar
2 years ago
Solved

KPI and GAUGE color formatting

Hi huys   I could really use your help! Pls note that I' using BI for just a couple of months now.   I have a KPI card and a GAUGE:   KPI CARD: VALUE is the actual, TARGET is my target and TRE...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  i_stanescu_ro ,

    I created some data:

     

    Here are the steps you can follow:

    You need to find the minimum and maximum values and then use the Switch() function to customize the colors..

    GAUGE Visual:

    1. Create measure.

    Color =
    var _mindate=MINX(ALL('Table'),[Amount])
    var _maxdate=MAXX(ALL('Table'),'Table'[Amount])
    var _divide=DIVIDE([Measure],_maxdate)
    RETURN
    SWITCH(
        TRUE(),
        _divide<0.85,"red",
        _divide>=0.85&&_divide<0.95,"orange",
        _divide>=0.95,"green")

    3. Visual – Color – Fill color –fx.

    3. Result:

    KPI Visual:

    Trend axis – fx

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly