Skip to content

Automatic translation — the Portuguese version is the reference. View in Portuguese

LOCALIZAR

On this page (10)

Position of the substring within the text (0 = not found).

FieldValue
CategoryText
TypeScalar (operates value by value)
Arity2 to 3 arguments
Compiles to SQL (calculated column)Yes
VersionFormula engine v3.

Aliases#

Canonical name: LOCALIZAR. Accepted aliases (case-insensitive): search, find.

Syntax#

code
LOCALIZAR(expr; arg2; [arg3])

All arguments are expressions.

Returns#

Number (position, 1-based; 0 when not found).

Null handling#

Not finding the substring returns 0 (it's not an error).

Evaluation context#

Scalar — evaluated on the result of the arguments (in calculated columns, it runs row by row).

Differences from DAX#

  • DAX equivalent: SEARCH / FIND
  • Compatibility: DIFFERS from DAX — different semantics, watch out
  • Note: Returns 0 when not found (DAX SEARCH/FIND returns an ERROR). It is always case-insensitive — including via the find alias, which would be case-sensitive in DAX.

Examples#

code
LOCALIZAR("SP"; uf)

Example with values#

Input: searches for "SP" in "RJ-SP-MG".

code
LOCALIZAR("SP"; "RJ-SP-MG")  →  4

Expected result: 4

Business example#

Standardize records and labels — CNPJ, SKU, channel name, report legends.

Common errors#

Typos in a column name, an incompatible type, or an invalid argument become a friendly message (pt-BR) — the engine never silently returns a wrong number.


← Back to the formula index

Related links