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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.