DAX Text - RIGHT function



Description

Returns the last characters in a text string, based on the number of characters you specify.

Syntax

RIGHT (<text>, [<num_times>]) 

Parameters

Sr.No. Parameter & Description
1

text

The text string that contains the characters you want to extract, or a reference to a column that contains text.

If the referenced column does not contain text, it will be implicitly cast to text.

2

num_times

Optional.

The number of characters you want RIGHT to extract. If omitted, default is 1.

You can also use a reference to a column that contains numbers.

Return Value

A text string or a calculated column of text strings.

Remarks

RIGHT always counts each character, whether single byte or double byte, as 1, no matter what the default language setting is.

  • If num_chars = 0, BLANK is returned.
  • If num_chars < 0, #ERROR value is returned.

Example

= RIGHT([Product],2) returns the right two characters of the values in the Product column.
= RIGHT([Product]) returns Blank values. 
dax_functions_text.htm
Advertisements