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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Kirt1965
Helper III
Helper III

How to dynamically set min & max values for custom color in gauge?

Hello all,

 

I am trying to make a gauge color change from say red to green as the value goes up.  The problem is I am forced to hard code minimum and maximum values when defining the colors to use.  See the first image below.

What I see.PNG

 

Microsoft documentation implies I should be able to give it a color for the minimum value in a column and maximum as seen below.  How do I get these choices, because hard coding a maximum is not ideal.  That value will change over time.  Thank you.

What Microsoft Says.PNG

 

1 ACCEPTED SOLUTION

Hi @Kirt1965 ,

 

The reason for not getting this option is because you are using the GAUGE visual.

The article you are referring to works on other visuals like table chart, bar chart, etc. not on Gauge visual.

 

If you need information on custom colors in gauge, refer the following article for this:

https://radacad.com/sentiment-colors-for-gauge-visual-in-power-bi

 

You will have to I think create a DAX expression for the custom colors you are looking for and then use it on your gauge.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@Kirt1965 , I doubt you can do that on color scale.

 

 

You can create a color measure and use that with "Field Value" Option

Color  = if(FIRSTNONBLANK(Table[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170 
,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")

color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
// Add more conditions
"red"
)

 

 

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Pragati11
Super User
Super User

Hi @Kirt1965 ,

 

You need to select the FIELD VALUE option while setting up colors for gauge visual. see below:

Pragati11_0-1599150476941.png

 

Under BASED ON THE FIELD section, select your column or measure on the basis of which you want to chnage the color.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Greg_Deckler
Super User
Super User

@Kirt1965 - Are you using rules or a color scale?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I am trying to use color scale exactly as the documentation shows at https://docs.microsoft.com/en-us/power-bi/visuals/service-tips-and-tricks-for-color-formatting

 

Capture.PNG

Hi @Kirt1965 ,

 

This article tells 2 ways of doing things.

  • Using CUSTOM option
  • DEFAULT option

If you are using CUSTOM option, then you have to give a manual value; for which you have shared the screesnhot.

 

You can chnage this CUSTOM option to DEFAULT option by using the dropdown:

Pragati11_1-1599151923924.png

 

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

The problem is it does not let me choose anything but custom.  That is my only choice.  Custom is all I get and I have to hard code numbers.

Hi @Kirt1965 ,

 

The reason for not getting this option is because you are using the GAUGE visual.

The article you are referring to works on other visuals like table chart, bar chart, etc. not on Gauge visual.

 

If you need information on custom colors in gauge, refer the following article for this:

https://radacad.com/sentiment-colors-for-gauge-visual-in-power-bi

 

You will have to I think create a DAX expression for the custom colors you are looking for and then use it on your gauge.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Thank you.  Basically confirms what I suspected - that the gauge visual doesn't work the same as some others when it comes to custom colors.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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