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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

power bi gauge conditional formatting

Hi,

 

I hope you can assist me.

I have a gauge graph with two numbers that change every month, I want to do conditional formatting that if the first number is bigger by the second, the color of the graph will be green and if other, it will be red.

Do you have any idea how to do it?

 

Thank you,

 

 

 

aviv5777_0-1680603400773.png

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

You might consider creating a conditional format for each measure in the matrix, like this.

Measure 1 = 
VAR _cur_month_value = [@Sales]
VAR _pre_month_value = CALCULATE([@Sales],DATEADD('Calendar'[Date],-1,MONTH))
VAR _color = IF(_cur_month_value>=_pre_month_value,"Green","Red")
RETURN
_color
Measure 2 = 
VAR _cur_month_value = [@Profit]
VAR _pre_month_value = CALCULATE([@Profit],DATEADD('Calendar'[Date],-1,MONTH))
VAR _color = IF(_cur_month_value>=_pre_month_value,"Green","Red")
RETURN
_color

vcgaomsft_0-1680759949160.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

You might consider creating a conditional format for each measure in the matrix, like this.

Measure 1 = 
VAR _cur_month_value = [@Sales]
VAR _pre_month_value = CALCULATE([@Sales],DATEADD('Calendar'[Date],-1,MONTH))
VAR _color = IF(_cur_month_value>=_pre_month_value,"Green","Red")
RETURN
_color
Measure 2 = 
VAR _cur_month_value = [@Profit]
VAR _pre_month_value = CALCULATE([@Profit],DATEADD('Calendar'[Date],-1,MONTH))
VAR _color = IF(_cur_month_value>=_pre_month_value,"Green","Red")
RETURN
_color

vcgaomsft_0-1680759949160.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Anonymous
Not applicable

Thank you! it worked!

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.