DAX Function Guide

TRIM
Empty image or helper icon

Sam McKay

CEO & Founder

How does the TRIM work?
The TRIM function (DAX) removes all spaces from text except for single spaces between words.
TRIM Formula Syntax

TRIM (
     <text>
)

How do you use the TRIM?

Use TRIM on text that you have received from another application that may have irregular spacing.

The TRIM function does not remove the nonbreaking space character. For an example of how to trim both space characters from text, see Remove spaces and nonprinting characters from text.

Related Blog Posts

Loading

Considerations when using the TRIM?

If you need to remove trailing non-breaking spaces, create a computed field using the following expression. The REPLACE( ) function replaces any non-breaking spaces with regular spaces, and then TRIM( ) removes any trailing regular spaces. TRIM( ) is related to the LTRIM( ) function, which removes any leading spaces from a string, and to the ALLTRIM( ) function, which removes both leading and trailing spaces.

Related Video Tutorials

Loading

Formula examples using the TRIM

=TRIM(“A column with trailing spaces. “)

=TRIM(” First Quarter Earnings “)

=TRIM(” First Quarter Earnings “)

Related Courses

Loading