cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Re: If text column CONTAINS specified value, give me what I want

This can now be done in DAX with the CONTAINSSTRING function:

MyCalculatedColumn = If(CONTAINSSTRING([TARGETCOLUMN];"searchforthis");TRUE();FALSE())
Highlighted
New Member

Re: If text column CONTAINS specified value, give me what I want

Hi, I have the same problem. I needed to classify these texts as "recordable" if not "non recordable"... 

these are recordable

Fatality     

Irreversible

Lost time

Medical treatment beyond first aid

Restricted work case

else 

Non-recordable...

 

my syntax goes like this.

 

Recordable Injuries IF(Injuriesver2[Severity]="Fatality",IF(Injuriesver2[Severity]="Irreversible",IF(Injuriesver2[Severity]="Lost time",IF(Injuriesver2[Severity]="Medical treatment beyond first aid",IF(Injuriesver2[Severity]="Restricted work case","Recordable","Non-recordable")))))

 

Highlighted
Super User IV
Super User IV

Re: If text column CONTAINS specified value, give me what I want

Hi,

Prepare a simple 2 column table with Text entries in the first column and Category in a second column.  The second column should have Recordable and Non-recordable.  Thereafter, build a relationship from the text column of your base data to the text column of thsi new 2 column dataset.  Write the =RELATED('Table2'[Category]) calculated column formula to fetch data from the Category column to Table1.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted
Microsoft
Microsoft

Re: If text column CONTAINS specified value, give me what I want

@PHEstaciMa1  based on your details , i have framed a small table  with One Column as Severity and other is a calculated Column 'Category' and used below formula to get desired output.

Category =
IF(('Table'[Severity]="Fatality" ||
'Table'[Severity]="Irreversible" ||
'Table'[Severity]="Lost time" ||
'Table'[Severity]="Medical treatment beyond first aid" ||
  'Table'[Severity]="Restricted work case"),
  "Recordable","Non-recordable")
attaching the result snapshot for reference.
let me know whether it solved your issue.

CalculateColumn.PNG

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Thanks
Santosh
Highlighted
Frequent Visitor

Re: If text column CONTAINS specified value, give me what I want

I know this is quite old, but this is the closest thread I came to solving what I think is the same need I had, but the proposed solutipms don't solve it. My use case - I have Table A, which has column X, and Table B, which has columns Y and Z. I want to do a fuzzy match on 'Table A'[X] against 'Table B'[Y] and return the value in 'Table B'[Z], so basically a LOOKUPVALUE using search.

 

In my example, Table A is called "Merged NPA5 and JIRA Query" and column X is "NPAID". Table B is called "FakeJira" and columns Y and Z are, respectively, "External Ticket Id" and "Value To Return". So it looks like this:

 

Merged NPA5 and JIRA Query:

2019-08-28_2118.png

FakeJira

2019-08-28_2115.png

 

And this is the result I wanted, where it can find a reference within External Ticket ID, but also handle blanks and duplicates, so gets this as a result:

 

2019-08-28_2123.png

Here's the query:
 
LookupBasedJiraID = FIRSTNONBLANK(selectcolumns(filter(FakeJira,search('Merged NPA5 and JIRA Query'[NPAID],FakeJira[External Ticket Id],,0)),"MyColumn",FakeJira[Value To Return]),TRUE())

 

The only thing now is to sort in the case where there's a duplicate, but that'll be trivial based on some other data.

 

Anyway, hope this helps - I think this is what the original requestor might have been wanting to do.

 

 

Paul.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors