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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
v-ankitgupta
Employee
Employee

How to set dynamic conditional formatting on color of gauge chart?

Screenshot 2022-12-08 155436.png

 

In my PowerBi report, I have added a guage chart, and applied conditional formatting, based upon 2 values:

  • Target
  • Actual Value

If the actual value is more than target, then the gauge chart will be green otherwise red. Now, based upon the data selected in a multi select drop down, the values of both 'Target' and 'Actual value' changes. Therefore, I want to have a dynamic conditional formatting for the guage chart where the conditional formatting for color is applied correctly according to different targets and their respective actual values.

 

For example:

Target;Actual Value;Color of Chart
8584Red
7779Green
6571Green

 

However, as displayed in the attached screenshot, the highlighted box expects a hardcoded numeric value. Please advise how to achieve this. Thanks in advance.

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

Hi @v-ankitgupta ,

 

Please try:

vjianbolimsft_0-1670549838268.png

Color = IF(SUM('Table'[Actual Value;])>SUM('Table'[Target;]),"Green","Red")

Final output:

vjianbolimsft_1-1670549897162.png

vjianbolimsft_2-1670549908271.png

Best Regards,

Jianbo Li

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

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @v-ankitgupta ,

 

Please try:

vjianbolimsft_0-1670549838268.png

Color = IF(SUM('Table'[Actual Value;])>SUM('Table'[Target;]),"Green","Red")

Final output:

vjianbolimsft_1-1670549897162.png

vjianbolimsft_2-1670549908271.png

Best Regards,

Jianbo Li

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

It worked Jianbo, Thank you very much.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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