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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.