Skip to content

Commit 9ec0481

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/query-docs-pr (branch live)
2 parents e19de42 + 99ba572 commit 9ec0481

3 files changed

Lines changed: 93 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CONTAINSSTRING(<within_text>, <find_text>)
2727

2828
## Remarks
2929

30-
- CONTAINSSTRING is not case-sensitive.
30+
- CONTAINSSTRING is case-insensitive, kanatype-insensitive, width-insensitive and accent sensitive.
3131

3232
- You can use `?` and `*` wildcard characters. Use `~` to escape wildcard characters.
3333

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "SEARCH function (DAX)"
66

77
[!INCLUDE[applies-to-measures-columns-tables-visual-calculations](includes/applies-to-measures-columns-tables-visual-calculations.md)]
88

9-
Returns the number of the character at which a specific character or text string is first found, reading left to right. Search is case-insensitive and accent sensitive.
9+
Returns the number of the character at which a specific character or text string is first found, reading left to right. Search is case-insensitive, kanatype-insensitive, width-insensitive, and accent sensitive.
1010

1111
## Syntax
1212

@@ -31,6 +31,8 @@ The number of the starting position of the first text string from the first char
3131

3232
- The search function is case insensitive. Searching for "N" will find the first occurrence of 'N' or 'n'.
3333

34+
- The search function is kanatype-insensitive, width-insensitive. Searching for "か" will find the first occurrence of 「か」 (hiragana), 「カ」 (katakana), or 「カ」 (half-width katakana).
35+
3436
- The search function is accent sensitive. Searching for "á" will find the first occurrence of 'á' but no occurrences of 'a', 'à', or the capitalized versions 'A', 'Á'.
3537

3638
- You can use the SEARCH function to determine the location of a character or text string within another text string, and then use the MID function to return the text, or use the REPLACE function to change the text.

query-languages/m/error-record.md

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,92 @@ Error.Record(
1919

2020
## About
2121

22-
Returns an error record from the provided text values for reason, message, detail, and error code.
22+
Returns an error record from the provided text values for reason, mesage, detail, and error code.
23+
24+
* `reason`: The high-level cause of the error.
25+
* `message`: (Optional) A description of the error.
26+
* `detail`: (Optional) Additional detailed information about the error.
27+
* `parameters`: (Optional) A list of values that provide additional context for the error, typically used for diagnostics or programmatic handling.
28+
* `errorCode`: (Optional) An identifier for the error.
29+
30+
## Example 1
31+
32+
Handle a divide by zero error.
33+
34+
**Usage**
35+
36+
```powerquery-m
37+
let
38+
input = 100,
39+
divisor = 0,
40+
result = try if divisor = 0 then
41+
error Error.Record(
42+
"DivideByZero",
43+
"You attempted to divide by zero."
44+
)
45+
else
46+
input / divisor
47+
in
48+
result
49+
```
50+
51+
**Output**
52+
53+
```powerquery-m
54+
[
55+
HasError = true,
56+
Error =
57+
[
58+
Reason = "DivideByZero",
59+
Message = "You attempted to divide by zero.",
60+
Detail = null,
61+
Message.Format = null,
62+
Message.Parameters = null,
63+
ErrorCode = null
64+
]
65+
]
66+
````
67+
68+
## Example 2
69+
70+
Handle an entry with a non-existent customer ID error. If no error occurs, indicate a successful entry.
71+
72+
**Usage**
73+
74+
```powerquery-m
75+
let
76+
CustomerId = 12345,
77+
result = try if CustomerId > 9999 then
78+
error Error.Record(
79+
"CustomerNotFound",
80+
Text.Format("Customer ID #{0} wasn't found.", {CustomerId}),
81+
"Customer doesn't exist.",
82+
{
83+
Text.Format("Invalid ID = #{0}", {CustomerId}),
84+
"Valid IDs: https://api.contoso.com/customers"
85+
},
86+
"ERR404"
87+
)
88+
else CustomerId
89+
in
90+
result
91+
```
92+
93+
**Output**
94+
95+
```powerquery-m
96+
[
97+
HasError = true,
98+
Error = [
99+
Reason = "CustomerNotFound",
100+
Message = "Customer ID 12345 wasn't found.",
101+
Detail = "Customer doesn't exist.",
102+
Message.Format = "Customer ID 12345 wasn't found.",
103+
Message.Parameters = {
104+
"Invalid ID = 12345",
105+
"Valid IDs: https://api.contoso.com/customers"
106+
},
107+
ErrorCode = "ERR404"
108+
]
109+
]
110+
```

0 commit comments

Comments
 (0)