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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
AKJB91
Regular Visitor

Conditional Column with Multiple Conditions

Hi All, 

I am looking for a little help to develop a conditional column which would tag the rows I have in my table dependant on what a certain column contains.

 

Say I have 3 columns and I am looking to develop the 4th column below where the rules are;

If Column "Area" contains 00111 & 00112 then "Both"

If Column "Area" contains 00111 then "00111"

If Column "Area" contains 00112 then "00112" 

Else "Check"

 

See below example,

NameIDAreaResult
A100111 - GGT;00112 - GFT;00113 - GTTBoth
B200111 - GGT00111
C300110 - CGTCheck
D400112 - GFT00112
E500111 - GGT;00112 - GFTBoth
F600114 - GHTCheck

 

I have attempted a number of formulas (IF statements & also conditional columns) but have not been able to find a suitable fix. It is the "Both" rule that I am struggling with as my approach appears to tag anything containing 00111 or 00112 as "Both" and I cannot find a way to add multiple rules via the conditional column option in transform data.

 

Any help greatly appreciated.

Thanks,

AB

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AKJB91 ,

Please have a try.

Add a custom column.

if Text.Contains([Area], "00111") and Text.Contains([Area], "00112") then "Both"
else if Text.Contains([Area], "00111") then "00111"
else if Text.Contains([Area], "00112") then "00112"
else "Check"

vrongtiepmsft_0-1709183518757.png

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

2 REPLIES 2
sandra1982
New Member

Hello

Can someone help with the below formula, it gives me null everywhere in the column

 

sandra1982_0-1710343834877.png= Table.AddColumn(#"Renamed Columns3", "Churn flag NEW", each if([Seniority group]="0-1 year" & [Reason for Action]="Termination") then "Churn" else "null")

Anonymous
Not applicable

Hi @AKJB91 ,

Please have a try.

Add a custom column.

if Text.Contains([Area], "00111") and Text.Contains([Area], "00112") then "Both"
else if Text.Contains([Area], "00111") then "00111"
else if Text.Contains([Area], "00112") then "00112"
else "Check"

vrongtiepmsft_0-1709183518757.png

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.