DAX Text - LEN function



Description

Returns the number of characters in a text string.

Syntax

LEN (<text>) 

Parameters

Sr.No. Parameter & Description
1

text

The text whose length you want to find, or a column that contains text.

Return Value

A whole number indicating the number of characters in the text string.

Remarks

Spaces count as characters.

DAX uses Unicode and stores all the characters with the same length. Hence, LEN always counts each character as 1, no matter what the default language setting is.

If you use DAX LEN function with a column that contains non-text values, such as dates or Boolean values, the function implicitly casts the value to text, using the current column format.

Example

= LEN ([Product]) 

Returns a calculated column with the number of characters in the corresponding Product text values.

dax_functions_text.htm
Advertisements