LEN

Updated on

LEN is a DAX function that returns the number of characters in a text string.

Syntax

LEN( Text )
Argument Properties Description
Text The text whose length you want to find. Spaces count as characters.

Return Values

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

Remarks

  • Whereas Microsoft Excel has different functions for working with single-byte and double-byte character languages, DAX uses Unicode and stores all characters with the same length.

  • LEN always counts each character as 1, no matter what the default language setting is.

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

Example

The following formula sums the lengths of addresses in the columns, [AddressLine1] and [AddressLine2].

= LEN([AddressLine1])+LEN([AddressLin2])

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/len-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy