Forum Discussion

melina's avatar
melina
Helper IV
9 years ago
Solved

if column contain keywords

Hi All,   My question similar like this link https://community.powerbi.com/t5/Desktop/DAX-If-a-column-contains-a-certain-value-then-a-column-contains/m-p/43797/highlight/false#M16892    but i inv...
  • Anonymous's avatar
    Anonymous
    9 years ago

    We can get cleverer.  Firstly, what is the formula to what you care about?  Does it have to be the first 3 characters?  Do you only want the ones that begin with F?

    For example you could do something like:

    My Measure = IF(
    	MID('YourTable'[Title], 4, 1) = "_",
    	LEFT([Title], 3),
    	""
    )

    This will check if your title starts with XXX_ and the make the result XXX.

    Does this idea help?