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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
i_stanescu_ro
Helper I
Helper I

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 TREND AXIS is month/year

GAUGE: VALUE is the actual, TARGET VALUE is my target

 

capturecapture

 

For the moment I have just green for met and above target and red for below target.

 

I would need to have this instead:

Red <85%

Orange 85-95%

Green >95%

 

Could you guys help me out?

 

Thanks so much!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @i_stanescu_ro ,

I created some data:

vyangliumsft_0-1712628293286.png

 

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.

vyangliumsft_1-1712628335194.png

vyangliumsft_2-1712628335195.png

3. Result:

vyangliumsft_3-1712628350214.png

KPI Visual:

Trend axis – fx

vyangliumsft_4-1712628361428.png

vyangliumsft_5-1712628361431.png

 

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @i_stanescu_ro ,

I created some data:

vyangliumsft_0-1712628293286.png

 

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.

vyangliumsft_1-1712628335194.png

vyangliumsft_2-1712628335195.png

3. Result:

vyangliumsft_3-1712628350214.png

KPI Visual:

Trend axis – fx

vyangliumsft_4-1712628361428.png

vyangliumsft_5-1712628361431.png

 

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

Thanks so much for your time!

Wow, thanks so much for this!

 

My issue is that I can't find the max and min of the range, because I also have a slicer for period, on months, and the data is from 2022 onwards and gets refreshed every month...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors