Skip to content

Commit 8050d53

Browse files
Merge pull request #386 from MicrosoftDocs/main639045433312988584sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 3897a73 + 2c5407f commit 8050d53

15 files changed

Lines changed: 122 additions & 17 deletions
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: "Configure Chinese coded character set (GB18030-2022) support"
3+
description: Use set UnicodeCharacterBehavior setting to support encoded characters according to GB18030-2022.
4+
author: jterh
5+
ms.author: jterh
6+
ms.topic: article
7+
ms.date: 01/05/2026
8+
ms.service: powerbi
9+
ms.subservice: dax
10+
---
11+
12+
# Chinese coded character set (GB18030-2022) support
13+
14+
China’s GB18030‑2022 standard is the latest update to the national character set requirements. It ensures compatibility with Unicode 11.0 and mandates support for additional characters, including minority scripts and emoji. For organizations operating in or with China, compliance is not optional; it’s a regulatory requirement.
15+
16+
Power BI can be configured to respect GB18030‑2022 encoding using the `UnicodeCharacterBehavior` setting. This setting is set to `CodeUnits` by default. To ensure your model is compatible with GB18030-2022, you’ll need to execute a specific XMLA command to set `UnicodeCharacterBehavior` to `CodePoints`, followed by a model refresh.
17+
18+
## XMLA command
19+
20+
```xmla
21+
<Alter AllowCreate="true" ObjectExpansion="ObjectProperties" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
22+
<Object>
23+
<DatabaseID>[your database id]</DatabaseID>
24+
</Object>
25+
<ObjectDefinition>
26+
<Database xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
27+
xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
28+
xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
29+
xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100"
30+
xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200"
31+
xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"
32+
xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300"
33+
xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300"
34+
xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400"
35+
xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400"
36+
xmlns:ddl500="http://schemas.microsoft.com/analysisservices/2013/engine/500"
37+
xmlns:ddl500_500="http://schemas.microsoft.com/analysisservices/2013/engine/500/500">
38+
<ID>[your model id]</ID>
39+
<Name>[your model name]</Name>
40+
<ddl200:CompatibilityLevel>[your model compatibility level]</ddl200:CompatibilityLevel>
41+
<ddl200_200:StorageEngineUsed>TabularMetadata</ddl200_200:StorageEngineUsed>
42+
<Language>1033</Language>
43+
<UnicodeCharacterBehavior xmlns="http://schemas.microsoft.com/analysisservices/2025/engine/924/924">CodePoints</UnicodeCharacterBehavior>
44+
</Database>
45+
</ObjectDefinition>
46+
</Alter>
47+
```
48+
49+
After executing this XMLA command, perform a full refresh of your model.
50+
51+
## Example
52+
53+
The UnicodeCharacterBehavior influences any DAX function that determines the length of a text string, which include [FIND](../find-function-dax.md), [LEFT](../left-function-dax.md), [LEN](../len-function-dax.md), [MID](../mid-function-dax.md), [REPLACE](../replace-function-dax.md), [RIGHT](../right-function-dax.md). These functions will exhibit different behaviors when working with text strings that contain Unicode characters.
54+
Let’s see the difference in action. Here’s a measure that uses LEN to calculate the length of a text string:
55+
56+
```dax
57+
StringLength = LEN ( SELECTEDVALUE ( 'Table'[Column1] ) )
58+
```
59+
60+
In this example, `Column1` contains three values:
61+
62+
- A
63+
- B🍕
64+
- 🍟🍔
65+
66+
Here’s a before and after comparison of the result of StringLength on a column that contains Unicode characters:
67+
68+
|`UnicodeCharacterBehavior = CodeUnits` (default)|`UnicodeCharacterBehavior = CodePoints`|
69+
|---|---|
70+
|:::image type="content" source="media/dax-unicode-character-behavior/unicodecharacterbehavior-codeunits.png" alt-text="Screenshot of a table showing Column 1 and StringLength. StringLength values are 1, 3 and 4." lightbox="media/dax-unicode-character-behavior/unicodecharacterbehavior-codeunits.png":::|:::image type="content" source="media/dax-unicode-character-behavior/unicodecharacterbehavior-codepoints.png" alt-text="Screenshot of a table showing Column 1 and StringLength. StringLength values are 1, 2 and 2." lightbox="media/dax-unicode-character-behavior/unicodecharacterbehavior-codepoints.png":::|
71+
72+
Notice how on the left each Unicode character has length 2, where on the right, each Unicode character has length 1.
73+
74+
> [!NOTE]
75+
> Changes to `UnicodeCharacterBehavior` only take hold after a model refresh.
76+
77+
## Related content
78+
79+
- [FIND](../find-function-dax.md)
80+
- [LEFT](../left-function-dax.md)
81+
- [LEN](../len-function-dax.md)
82+
- [MID](../mid-function-dax.md)
83+
- [REPLACE](../replace-function-dax.md)
84+
- [RIGHT](../right-function-dax.md)

query-languages/dax/best-practices/dax-user-defined-functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ author: hsteffens30
55
ms.author: jterh
66
ms.topic: best-practice
77
ms.date: 09/15/2025
8+
ms.service: powerbi
9+
ms.subservice: dax
810
---
911

1012
# DAX user-defined functions (preview)
13.8 KB
Loading
11.4 KB
Loading

query-languages/dax/find-function-dax.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Number that shows the starting point of the text string you want to find.
3636

3737
- FIND does not support wildcards. To use wildcards, use [SEARCH](search-function-dax.md).
3838

39+
- [!INCLUDE [function-unicodecharacterbehavior](includes/function-unicodecharacterbehavior.md)]
40+
3941
## Example
4042

4143
The following DAX query finds the position of the first letter of "Bike", in the string that contains the reseller name. If not found, Blank is returned.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
author: jterh
3+
ms.author: jterh
4+
ms.topic: article
5+
ms.date: 01/05/2026
6+
ms.service: powerbi
7+
ms.subservice: dax
8+
ms.topic: include
9+
---
10+
This function returns different results depending on [the UnicodeCharacterBehavior setting of your model](../best-practices/dax-unicode-character-behavior.md).

query-languages/dax/left-function-dax.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ A text string.
3232

3333
- [!INCLUDE [function-not-supported-in-directquery-mode](includes/function-not-supported-in-directquery-mode.md)]
3434

35+
- [!INCLUDE [function-unicodecharacterbehavior](includes/function-unicodecharacterbehavior.md)]
36+
3537
## Example
3638

3739
The following example returns the first five characters of the company city in the column [City] and the first five letters of the reseller key in the column [ResellerKey] and concatenates them, to create an identifier.

query-languages/dax/len-function-dax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ A whole number indicating the number of characters in the text string.
2929

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

32-
- LEN always counts each character as 1, no matter what the default language setting is.
33-
3432
- 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.
3533

34+
- [!INCLUDE [function-unicodecharacterbehavior](includes/function-unicodecharacterbehavior.md)]
35+
3636
## Example
3737

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

query-languages/dax/mid-function-dax.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ A string of text of the specified length.
2828

2929
## Remarks
3030

31-
Whereas Microsoft Excel has different functions for working with single-byte and double-byte characters languages, DAX uses Unicode and stores all characters with the same length.
31+
- Whereas Microsoft Excel has different functions for working with single-byte and double-byte characters languages, DAX uses Unicode and stores all characters with the same length.
32+
33+
- [!INCLUDE [function-unicodecharacterbehavior](includes/function-unicodecharacterbehavior.md)]
3234

3335
## Examples
3436

query-languages/dax/orderby-statement-dax.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ To learn more about how ORDER BY statements are used, see [DAX queries](dax-quer
3131

3232
## Related content
3333

34-
[START AT](startat-statement-dax.md)
35-
[EVALUATE](evaluate-statement-dax.md)
36-
[VAR](var-dax.md)
37-
[DEFINE](define-statement-dax.md)
38-
[DAX queries](dax-queries.md)
34+
- [START AT](startat-statement-dax.md)
35+
- [EVALUATE](evaluate-statement-dax.md)
36+
- [VAR](var-dax.md)
37+
- [DEFINE](define-statement-dax.md)
38+
- [DAX queries](dax-queries.md)

0 commit comments

Comments
 (0)