RIGHT
The last characters of a text (one by default).
Group: Text. Compatible with DAX.
Syntax
RIGHT ( <text> [, <num_chars>] )
| Parameter | Type | Description |
|---|---|---|
text | Text | The text to take characters from; a number becomes text first. |
num_chars | Whole number optional | How many characters to take from the end; 1 when left out. |
Returns
Text. The last characters of the text.
Remarks
- Asking for more characters than the text has gives the whole text.
- A blank text gives BLANK. A negative number of characters is an error; a fraction is rounded, a half away from zero.
- Characters are counted as DAX counts them, so most emoji take two.
Examples
The last characters
EVALUATE
ROW (
"Four", RIGHT ( "Account 3000", 4 ),
"Left out", RIGHT ( "abc" ),
"More than there are", RIGHT ( "abc", 9 ),
"Of a number", RIGHT ( 2026, 2 )
)
| Four | Left out | More than there are | Of a number |
|---|---|---|---|
| 3000 | c | abc | 26 |