DAX Text - TRIM function



Description

Removes all the spaces from the text except for single spaces between words.

Syntax

TRIM (<text>) 

Parameters

Sr.No. Parameter & Description
1

text

The text from which you want spaces removed, or a column that contains text.

Return Value

A text string.

Remarks

You can use DAX TRIM function on the text that you have received from another application that may have irregular spacing.

When you use DAX TRIM function on a column of text with trailing spaces, the results of the TRIM function may not be apparent in the calculated column. However, you can compare the length of the input text and the resulting text to find the difference.

Example

= TRIM ("Product used for Fabric Care")  

returns Product used for Fabric Care. If you use TRIM function on a column of text values, the results might not be visible. You can use LEN function on both, the parameter column and the resulting column, to compare the lengths of the strings.

dax_functions_text.htm
Advertisements