-
Notifications
You must be signed in to change notification settings - Fork 89
Update LEN function behavior details in documentation #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Clarified behavior of LEN function with UnicodeCharacterBehavior property on model
|
@rashidsarwar : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit 0cfeeea: ✅ Validation status: passed
For more details, please refer to the build report. |
jeroenterheerdt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after we agree with this update we should make sure to update all the other pages
|
|
||
| - 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. |
There was a problem hiding this comment.
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.
|
|
||
| - 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. | ||
| - 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. |
There was a problem hiding this comment.
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.
|
#label:"aq-pr-triaged" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the documentation for the DAX LEN function to clarify its behavior with the new UnicodeCharacterBehavior model property. The update explains how the function handles Unicode characters differently based on whether the property is set to CodeUnits (default, legacy behavior) or CodePoints (new behavior), using emoji as an example.
- Adds documentation explaining the UnicodeCharacterBehavior property's impact on LEN function behavior
- Provides examples showing how emoji characters are counted differently with CodeUnits vs CodePoints settings
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - 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
AI
Dec 17, 2025
There was a problem hiding this comment.
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.
| - 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. |
| - 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
AI
Dec 17, 2025
There was a problem hiding this comment.
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).
| - 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. |
| - 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
AI
Dec 17, 2025
There was a problem hiding this comment.
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).
| - 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. |
| - 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
AI
Dec 17, 2025
There was a problem hiding this comment.
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.
| - 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. |
| - 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. | ||
| - 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
AI
Dec 17, 2025
There was a problem hiding this comment.
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.
|
|
||
| - 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. |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
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.
| - 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. |
| - 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
AI
Dec 17, 2025
There was a problem hiding this comment.
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.
| - 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. |
Clarified behavior of LEN function with UnicodeCharacterBehavior property on model