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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MKPartner
Helper I
Helper I

Wrong conditional formatting color

Hello, 

 

I have look into the old topics but I didn't find an answer. 

 

Simply speaking, I have built simple DAX for comparision of two values. 

Color var_value_lining = SWITCH(True(),
                    SUM('Lining'[var_value])='Lining'[var_vall_check],
                            "#44B62D",
                            "#FF0000")

Where Lining [var_value] is a column but Lining [var_vall_check] is a measure. 

 

Seems to be simple but almost all the time is showing reds even if those two values are equal. 

 

MKPartner_0-1738585125276.png

 

Could you please advice some solution ? 

 

1 ACCEPTED SOLUTION
Joe_Barry
Super User
Super User

Hi @MKPartner 


How many decimal places does 'Lining'[var_value] have? You can try rounding the Measure to that number. If it's two, then use blow, adapt to the decimal places you have in the table

ROUND(var_vall_check], 2)

Joe




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


View solution in original post

2 REPLIES 2
MKPartner
Helper I
Helper I

Thank you for support. 

Joe_Barry
Super User
Super User

Hi @MKPartner 


How many decimal places does 'Lining'[var_value] have? You can try rounding the Measure to that number. If it's two, then use blow, adapt to the decimal places you have in the table

ROUND(var_vall_check], 2)

Joe




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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