Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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,
Solved! Go to Solution.
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
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
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
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
Thank you! it worked!