Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions query-languages/dax/len-function-dax.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ A whole number indicating the number of characters in the text string.

- 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.

- Starting with desktop january release, user can set new model property UnicodeCharacterBehavior. Depending on value of the property, the output of LEN(<text>) function changes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend we don't make it so dependent on the january release in the docs. I'd just say: In recent versions, you can set the UnicodeCharacterBehavior property.

Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The month name "january" should be capitalized to "January" for proper noun capitalization. Additionally, "user" should be "users" or "the user" for better grammar.

Suggested change
- Starting with desktop january release, user can set new model property UnicodeCharacterBehavior. Depending on value of the property, the output of LEN(<text>) function changes.
- Starting with the January desktop release, users can set the new model property UnicodeCharacterBehavior. Depending on value of the property, the output of LEN(<text>) function changes.

Copilot uses AI. Check for mistakes.
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀) will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀) will return => 1. This will be new behavior of LEN function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there a ' missing? len('🍕')? same a couple of lines earlier.

Comment on lines +36 to +37
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string literal '😀 is missing a closing single quote. It should be '😀' to properly close the string.

Suggested change
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀) will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀) will return => 1. This will be new behavior of LEN function.
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀') will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀') will return => 1. This will be new behavior of LEN function.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +37
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name should be consistently uppercase. Change "len('😀)" to "LEN('😀')" to match the standard DAX function naming convention used throughout the documentation (e.g., line 14, 31, 33, 41).

Suggested change
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀) will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀) will return => 1. This will be new behavior of LEN function.
- With CodeUnits default value of UnicodeCharacterBehavior property, the LEN('😀') will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the LEN('😀') will return => 1. This will be new behavior of LEN function.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +37
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name should be consistently uppercase. Change "len('😀)" to "LEN('😀')" to match the standard DAX function naming convention used throughout the documentation (e.g., line 14, 31, 33, 41).

Suggested change
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀) will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀) will return => 1. This will be new behavior of LEN function.
- With CodeUnits default value of UnicodeCharacterBehavior property, the LEN('😀') will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the LEN('😀') will return => 1. This will be new behavior of LEN function.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +37
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider replacing the informal "=>" notation with clearer language such as "will return 2" or "returns 2" to be consistent with more formal technical documentation style.

Suggested change
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀) will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀) will return => 1. This will be new behavior of LEN function.
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀) returns 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀) returns 1. This will be new behavior of LEN function.

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +37
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new documentation about UnicodeCharacterBehavior contradicts the existing remark on line 31 which states "LEN always counts each character as 1, no matter what the default language setting is." Since the behavior now changes based on the UnicodeCharacterBehavior property setting, line 31 should be updated to clarify that this statement applies only to the default CodeUnits behavior, or be revised to reflect the conditional behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +37
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string literal '😀 is missing a closing single quote. It should be '😀' to properly close the string.

Suggested change
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀) will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀) will return => 1. This will be new behavior of LEN function.
- With CodeUnits default value of UnicodeCharacterBehavior property, the len('😀') will return => 2. This is old behavior of LEN function.
- With CodePoints value of UnicodeCharacterBehavior property, the len('😀') will return => 1. This will be new behavior of LEN function.

Copilot uses AI. Check for mistakes.

## Example

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