Forum Discussion
ShaneL79
Helper I
6 years agoContains Partial Text
This is probably a dumb question, but I want to countrows where "blue" is contained within the column.
The column typically has several results that look like this "Red >> Blue >> Orange"
I know equals is "=", and does not equal is "<>", but what is contains?
Here is the sample of my code, which structure I would like to maintain for the sake of my beginner knowledge.
Assessments =
CALCULATE (
COUNTROWS (Alarms),
Alarms[Assessments Employee] = " Blue ",
Hi ShaneL79 ,
You can also use "find" or "seach",such as:
Assessments= var a =search("blue",SELECTEDVALUE('Alarms'[Assessments Employee]),,0) Return IF(a<>0,COUNTROWS('Alarms'),BLANK())Best Regards,
KellyDid I answer your question? Mark my post as a solution!
2 Replies
- ImkeF
Community Champion
Hi ShaneL79
the CONTAINSSTRING-function should do this job: https://docs.microsoft.com/en-us/dax/containsstring-function-dax
- v-kelly-msft
Community Support
Hi ShaneL79 ,
You can also use "find" or "seach",such as:
Assessments= var a =search("blue",SELECTEDVALUE('Alarms'[Assessments Employee]),,0) Return IF(a<>0,COUNTROWS('Alarms'),BLANK())Best Regards,
KellyDid I answer your question? Mark my post as a solution!