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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.