OpenBI Docs Buy

FIND

Where a text first appears in another, case counting, from a start position; a value of your choice, or an error, when it doesn't.

Group: Text. Compatible with DAX.

Syntax

FIND ( <find_text>, <within_text> [, <start_num>] [, <NotFoundValue>] )
ParameterTypeDescription
find_textTextWhat to look for.
within_textTextThe text to look in.
start_numWhole number
optional
The character to start looking from; 1, the first, when left out.
NotFoundValueValue
optional
What to return when the text is not there, often 0 or BLANK (). Left out, that is an error.

Returns

Whole number. The position of the first character of the match, counting from 1.

Remarks

  • Upper and lower case count, and * and ? are ordinary characters. SEARCH ignores case and takes them as wildcards.
  • The position counts from the start of the text, wherever the search began.
  • When the text is not found and no NotFoundValue is given, the result is an error: give one whenever a missing text is possible.
  • A start below 1 is an error; a start past the end finds nothing.
  • An empty find_text is found at position 1.

Examples

Case counts

plant is found at the 8th character; Plant is not there, so the NotFoundValue 0 comes back.

EVALUATE
ROW (
    "Small p", FIND ( "plant", "Bergen plant" ),
    "Capital P", FIND ( "Plant", "Bergen plant", 1, 0 )
)
Small pCapital P
80

Starting further in

EVALUATE
ROW (
    "From the start", FIND ( "s", "Mississippi" ),
    "From the 5th", FIND ( "s", "Mississippi", 5 )
)
From the startFrom the 5th
36

The text before a dash

EVALUATE
ROW ( "Shop", LEFT ( "Oslo-2026", FIND ( "-", "Oslo-2026" ) - 1 ) )
Shop
Oslo

SEARCH, CONTAINSSTRINGEXACT, MID, LEFT, SUBSTITUTE.

Last updated · OpenBI Studio 0.3.74