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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Shadd307
Frequent Visitor

IF and with a contains criteria

I have a table that has numerous columns but I an trying to create a new column called work group where the issue type = "Initiative" and labels contains "Bank Name" and if both true "Bank Name" else "Not Bank Name"

 

Issue TypeLabelsWork Group (new Column)
Initiative[Bank; Q4; Data team]Bank
Story[Bank; Q1; Docs]

Not Bank

Initiative[Market; Q4; Policy]Not Bank
Etc...  
3 REPLIES 3
Comex_Palmali
New Member

You can try something like this:

WorkGroup = IF(AND(Planilha1[Issue Type]="Initiative",LEFT(Planilha1[Labels], FIND(";",Planilha1[Labels])-1)="[Bank"),"Bank","Not bank")

 

With this I have achieved the same result that you want.

hokeson
Employee
Employee

it looks like you need to create conditional column.

#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "WorkGroup", each if Text.Contains([Issue Type], "Initiative") and Text.Contains([Labels], "Bank") then "Bank" else "Not Bank")

truptis
Community Champion
Community Champion

@Shadd307 ,

Try this:

Result = IF([issuetype] = "initiative", IF( containstring(tablename, [label], "bank name", "Bank", "Not Bank"), "not bank"))

 

@Shadd307 -> if this helps you then please hit the thumbs up and mark it as a solution. Thanks.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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