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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jsaue003
Frequent Visitor

AND IF in conditional column

Hello.

 

I have three columns with health values (Scope Health, Schedule Health, Budget Health) and four category columns which are supposed to be populated with Path to Green if any of the three columns with health values are other than green. I've tried a custom column with the following: 

 

if [Scope Health] <> "Green" or [Schedule Health] <> "Green" or [Budget Health] <> "Green" 

AND 

[Category 1] <> "Path to Green" or [Category 2] <> "Path to Green" or [Category 3] <> "Path to Green"or [Category 4] <> "Path to Green" 

THEN "Yes"

 

No matter what I swap around I can't get this to say "Yes" correctly. The function itself gives me errors (token THEN expected). How can I achieve this? 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

I believe you want this:

 

if ([Scope Health] <> "Green" or [Schedule Health] <> "Green" or [Budget Health] <> "Green") and [Category 1] <> "Path to Green" or [Category 2] <> "Path to Green" or [Category 3 <> "Path to Green" or [Category 4] <> "Path to Green" then "Yes" else "No"

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

I believe you want this:

 

if ([Scope Health] <> "Green" or [Schedule Health] <> "Green" or [Budget Health] <> "Green") and [Category 1] <> "Path to Green" or [Category 2] <> "Path to Green" or [Category 3 <> "Path to Green" or [Category 4] <> "Path to Green" then "Yes" else "No"

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.