DAX function
LEN — DAX function reference
Count characters.
Syntax
dax
LEN(<text>)
Examples
dax
LEN([Code])
→ A number
dax
FILTER(Customer, LEN(Customer[Phone]) <> 10)
→ Rows with a malformed (not 10-digit) phone number, for a data-quality check
dax
IF(LEN(Product[Description]) > 100, LEFT(Product[Description], 97) & "...", Product[Description])
→ Truncates a long description for display, with an ellipsis
Common mistakes & gotchas
- LEN(BLANK()) returns 0, not blank or an error, so a length-based data-quality filter needs a separate ISBLANK() check if you also want to catch missing values, not just wrong-length ones.
Related DAX functions
From Text