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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors