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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
devika
Helper II
Helper II

If and multiple conditions

I'm creating a column with 'And' ,'Multiple Conditions'

 

Co = IF(and[RRR]=1, ([Highest]="Rer" or [Highest]="Con" or [Highest]="EC") then 1 else 0)
 
I worked out for single conditon but trying to tackle multiple conditions. any help would be great, thanks

Co = IF(AND([RRR]=1, [Highest]="Rer"),1,0)

1 ACCEPTED SOLUTION
littlemojopuppy
Community Champion
Community Champion

Hi.  Try this...

 

IF(
	AND(
		[RRR] = 1,
		[Highest] IN {"Rer", "Con", "EC"}
	),
	1,
	0
)

 

 

 

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@devika , if you are trying on power Query/M

Co = if [RRR]=1 and ([Highest]="Rer" or [Highest]="Con" or [Highest]="EC") then 1 else 0

or

Co = if [RRR]=1 and [Highest] in {"Rer" , "Con" ,"EC" }  then 1 else 0

 

In DAX a new column

Co = IF([RRR]=1 && [Highest] in {"Rer" , "Con" ,"EC" } , 1 , 0)

 

devika
Helper II
Helper II

I managed to solve by Switch(true(), [rrr]=1 && [Highest] ="Rer",1,[rrr]=1 && [Highest] ="Con",1,0)

 

I will yours solution too and post it here. thanks for you reply

littlemojopuppy
Community Champion
Community Champion

Hi.  Try this...

 

IF(
	AND(
		[RRR] = 1,
		[Highest] IN {"Rer", "Con", "EC"}
	),
	1,
	0
)

 

 

 

Something around IN Operator is not right.

 

Getting Token Comma Expected error... not sure what is missed

Can you paste your code?  I tried it in another project and worked perfectly

Helpful resources

Announcements
Europe Fabric Conference

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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