RIGHT

How to Use the Power BI DAX function RIGHT

What is the RIGHT Function?

The RIGHT function is a DAX function that is used to extract a specified number of characters from the right side of a text string. It returns a new text value that contains the extracted characters. The basic syntax of the RIGHT function is as follows:


RIGHT(❰text❱, ❰num_chars❱)


Here, `❰text❱` is the text string that you want to extract characters from, and `❰num_chars❱` is the number of characters you want to extract.

How Does the RIGHT Function Work?

The RIGHT function works by extracting a specified number of characters from the right side of a text string. For example, if you have a text string "Power BI is awesome", and you want to extract the last four characters "some", you can use the RIGHT function with the following formula:


RIGHT(“Power BI is awesome”, 4)


The function will return the text value "some".

How to Use the RIGHT Function in Power BI

To use the RIGHT function in Power BI, you can follow these steps:

1. Open the Power BI Desktop application and create a new report.

2. Select the table or column where you want to use the RIGHT function.

3. Click on the "New Column" button in the "Modeling" tab.

4. In the formula bar, type the following formula:


New Column Name = RIGHT(❰text❱, ❰num_chars❱)


Here, `❰text❱` is the name of the column you want to extract characters from, and `❰num_chars❱` is the number of characters you want to extract.

5. Press Enter to create the new column.

6. The new column will appear in the "Fields" section.

7. Drag and drop the new column to the report canvas to use it in your visualizations.

Tips for Using the RIGHT Function Effectively

Here are some tips that can help you use the RIGHT function effectively in your Power BI reports:

- Use the RIGHT function to extract specific parts of a text string, such as dates or codes.

- Combine the RIGHT function with other DAX functions, such as FIND or LEN, to extract more complex patterns.

- Use the RIGHT function in conjunction with other visualizations, such as tables or charts, to analyze your data in different ways.

- Test your formulas thoroughly before using them in production to ensure that they are accurate and reliable.

The RIGHT function is a powerful DAX function that can be used to extract a specified number of characters from the right side of a text string. By following the steps outlined in this article, you can start using the RIGHT function in your Power BI reports and gain greater insights into your data. Remember to test your formulas thoroughly and use the RIGHT function in conjunction with other DAX functions and visualizations to get the most out of your data.

Power BI DAX Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

11-13 November 2024

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)