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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Conditional formatting

I am trying to use "Switch" to return values but cannot work out how to used the "Or" funtion within the DAX

 

Response SLA Met =
SWITCH(
TRUE(),
Incidents[Priority] = "Critical", AND (Incidents[Respond Time Hrs] <1.5, "True"
))
 
Works as expected BUT i also need to use Or to complete the required outcome
 
Incidents[Priority] = "High", AND (Incidents[Respond Time Hrs] <3.0, "True"
 
Any advise would be appreciated
 
Gary Gray
1 ACCEPTED SOLUTION
jennratten
Super User
Super User

In switch statemetns you can include AND critiera like this && and OR criteria like thisYou can include AND criteria OR criteria in your switch statement like this ||.

 

Response SLA Met =
SWITCH(
TRUE(),
-- Priority = Critical and Respond Time Hrs < 1.5
Incidents[Priority] = "Critical" && (Incidents[Respond Time Hrs] <1.5, "True",
-- Priority = Critical or Respond Time Hrs < 1.5
Incidents[Priority] = "Critical" || (Incidents[Respond Time Hrs] <1.5, "True",
"False"
)

View solution in original post

1 REPLY 1
jennratten
Super User
Super User

In switch statemetns you can include AND critiera like this && and OR criteria like thisYou can include AND criteria OR criteria in your switch statement like this ||.

 

Response SLA Met =
SWITCH(
TRUE(),
-- Priority = Critical and Respond Time Hrs < 1.5
Incidents[Priority] = "Critical" && (Incidents[Respond Time Hrs] <1.5, "True",
-- Priority = Critical or Respond Time Hrs < 1.5
Incidents[Priority] = "Critical" || (Incidents[Respond Time Hrs] <1.5, "True",
"False"
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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