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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX conditional formatting

Hi all,
 
I am trying to create a measure for conditional formatting of background colour.
The conditional format is set up as the higher the better for most of my variables, however for four of my variables it should be the lower the better therefore the conditional formatting should be inverted.
 
Please see below the DAX I have so far;
 
Dynamic Background =

 

VAR red = "#e68f96"
VAR amber = "#ffd700"
VAR green = "#a4ff73"

 

VAR threshold = SWITCH(TRUE(),
VALUES('Readiness Unpivoted'[Test]) = "Sleep Quality", [Readiness Upper],
VALUES('Readiness Unpivoted'[Test]) = "Fatigue", [Readiness Upper],
VALUES('Readiness Unpivoted'[Test]) = "External Stress", [Readiness Upper],
VALUES('Readiness Unpivoted'[Test]) = "Muscle Soreness", [Readiness Upper],
[Readiness Lower])
 
VAR above = IF([Readiness Value] >= [Readiness AVG Selected], green)
VAR below = IF([Readiness Value] < threshold, red)
VAR between = IF([Readiness Value] <= [Readiness AVG Selected], IF([Readiness Value] >= threshold, amber))
 
I now need to invert the conditional format.
I hope this makes sense and thanks in advance.
 
Sean
2 REPLIES 2
MattAllington
Community Champion
Community Champion

You haven't provided ani info about the various  "readiness" measures, so it is hard to say. I suggest you investigate multiplying one of your measures by -1 to flip the biggest to smallest. It is hard to say where to do that given the info provided, but that is what I would be looking to do if it were me. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Thanks for your reply. Apologies if I was not clear.

However I did manage to figure it out by using SWITCH to change the calculation for the four 'Readiness Tests'.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.