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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Several conditions if with color

Hi, I would like to create a dax measure with multiples conditions with different measures.

My goal is to create an if-else and return the last  True condition

for example 

IF( [D] >0, then "yellow",else: "red")

IF ([D] >0 and [S] >0 , then "green")

IF(D>0 and [S]>0 and [T] >0, then "Blue")

 

If only the first condition is respected return "yellow"

If the first and the second conditions are respected so it returns "green"

If the third one is respected return "blue"

 

Thank you for helping

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try like

 

Switch( True(),
D>0 and [S]>0 and [T] >0, "Blue" ,
[D] >0 and [S] >0 , "green",
[D] >0, "yellow",
"Red")

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you so much @amitchandak  it works ! 😄

amitchandak
Super User
Super User

@Anonymous , try like

 

Switch( True(),
D>0 and [S]>0 and [T] >0, "Blue" ,
[D] >0 and [S] >0 , "green",
[D] >0, "yellow",
"Red")

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors