DAX Function Guide

RIGHT
Empty image or helper icon

Sam McKay

CEO & Founder

How does the RIGHT work?
The RIGHT function (DAX) returns the last character or characters in a text string, based on the number of characters you specify.
RIGHT Formula Syntax

RIGHT (
     <text>, <num_chars>
)

How do you use the RIGHT?

The RIGHT function can be used to counts each character, whether single-byte or double-byte, as 1, no matter what the default language setting is.

This DAX function may return different results when used in a model that is deployed and then queried in DirectQuery mode.

Related Blog Posts

Loading

Considerations when using the RIGHT?
  • Text (required) – the text string from which you want to extract characters.
  • Num_chars (optional) – the number of characters to extract, starting from the rightmost character.
    • If num_chars is omitted, 1 last character of the string is returned (default).
    • If num_chars is greater than the total number of characters in the string, all characters are returned.
    • If num_chars is a negative number, a Right formula returns the #VALUE! error.
Related Video Tutorials

Loading

Formula examples using the RIGHT

=RIGHT(‘New Products'[ProductCode],2)

=RIGHT(A2, 3)

=RIGHT(A2,LEN(A2)-SEARCH(” “,A2))

Related Courses

Loading