Mastering Text Functions in DAX

Analytics can be numerically driven, but what actually makes data legible is text. DAX text functions are the set of tools for cleaning, formatting, merging, and reshaping string data in Power BI. These functions help take raw data and make it into reports that are sharper, easier to comprehend, and far easier to utilize, be it by fixing mixed-up names, pulling out product codes, or generating dynamic titles, clean labels, or exporting data as text.

1.Understanding DAX Text Functions

When dealing with string values in Power BI, DAX text functions prove useful. For your reports to be readable and user-friendly, you can apply them to clean, format, split, join, and unpivot text. Common uses include removing unnecessary spaces, pulling text, concatenating columns to create sentences, and creating dynamic image labels.

Categories of DAX Text Functions:
CategoryFunctionsPurpose
Case ConversionUPPER, LOWERConvert to upper/lowercase.
Trimming & CleaningTRIMRemove extra spaces.
ExtractionLEFT, RIGHT, FINDExtract or find substrings.
ConcatenationCONCATENATE, CONCATENATEX, COMBINEVALUES, REPTJoin text; COMBINEVALUES = delimited; REPT = repeat.
Length & ComparisonLEN, EXACTLength or exact (case‑sensitive) match.
Formatting & ReplacementFORMAT, FIXED, REPLACE,  VALUEFormat/replace text; VALUE = number.
OtherUNICHAR, UNICODEcharacter from code; code point.

We’ll go over 18 DAX text functions in this guide with:
Syntax: how it is written
Example: actual DAX from our sample dataset;
Outcome: Before and After (from Power BI output)
A sample table named Data from our dataset is used in all examples.

2.Functions and Their Description

COMBINEVALUES

Combines the given set of operands using a specified delimiter.

Text box displaying the syntax and explanation of the DAX function COMBINEVALUES, including details on delimiter and expressions used in concatenation.

Example:

 Country|City = COMBINEVALUES("|", Data[Country], Data[City])

Outcome:

Screenshot of Power BI displaying a data table with columns for Country, City, and concatenated Country|City. The table includes countries such as China, Germany, India, and the United States with corresponding city names.

CONCATENATE

Join two text strings into one text string.

Syntax explanation of the CONCATENATE function in DAX, showing how to combine two text strings into a single value.

Example:

FullName Concat = CONCATENATE(Data[FirstName], Data[LastName])

Outcome:

A screenshot of Power BI displaying a data table with columns for FirstName, LastName, and FullName Concatenation. The table shows various names with corresponding concatenated results for ease of data presentation.

CONCATENATEX

Evaluates expression for each row on the table, then returns the concatenation of those values in a single string result, separated by the specified delimiter.

Syntax description of the CONCATENATEX function in DAX, outlining the parameters: Table, Expression, and Delimiter.

Example:

Cities List = CONCATENATEX(VALUES(Data[City]), Data[City], ", ")

Outcome:

Screenshot of Power BI interface displaying a visual titled 'Cities List' with a list of cities including Seattle, Delhi, Madrid, London, Berlin, Valencia, Beijing, Rome, Dubai, and Mexico City.

EXACT

Checks whether two text strings are the same and returns TRUE or FALSE. EXACT is case-sensitive.

Syntax description of the DAX function EXACT with parameters for Text1 and Text2, presented in a gray box.

Example:

Exact City Match = EXACT( TRIM(Data[City]), TRIM(Data[UPPER City]) )

Outcome:

Table displaying city names, their uppercase versions, and an exact match status in Power BI.

FIND

Return the starting position of one text string within another text string. FIND is case-sensitive.

Syntax and explanation of the DAX FIND function, detailing parameters like FindText, WithinText, Start Position, and NotFoundValue.

Example:

FIND BI = FIND("BI", Data[Notes], 1, BLANK())

Outcome:

Screenshot of Power BI interface displaying the 'Find BI' notes section with various text entries including data cleaning tips and examples of DAX text functions.

FIXED

Rounds a number to the specified number of decimals and returns the result as text with optional commas.

Annotation box displaying the syntax and explanation of the DAX FIXED function for rounding numbers and converting them to text.

Example:
Formatted to 2 decimals with separators:

Amount Fixed (Text) = FIXED( Data[Amount], 2, FALSE ) → e.g., 1,234.50 (locale-aware).

Rounded to nearest thousand, no separators:

Amount K (Text) = FIXED( Data[Amount], -3, TRUE ) → e.g., 123000.

Need it back as a number:

Amount Fixed (Number) = VALUE( FIXED( Data[Amount], 2, TRUE ) )

Outcome:

A Power BI table displaying financial data with three columns: 'Amount Fixed (Text)', 'Amount K (Text)', and 'Amount Fixed (Number)', along with a total row showing '1,10,125.31'.

FORMAT

Converts a value to text in the specified number format.

Table summarizing the syntax and parameters of the FORMAT function in DAX, displaying 'Syntax', 'Value', and 'Format' descriptions.

Example:

Amount Currency = FORMAT(Data[Amount], "$#,##0.00")

Outcome:

Table displaying the sum of amounts and their corresponding currency values in Power BI, including various numeric formats.

LEFT

Returns the specified number of characters from the start of a text string.

Diagram explaining the syntax of the DAX LEFT function, including parameters for Text and NumberOfCharacters.

Example:

LEFT ProductCode (3) = LEFT(Data[ProductCode], 3)

Outcome:

Screenshot of Power BI showing a table with 'ProductCode' and a DAX function 'LEFT ProductCode (3)' that extracts the first three characters of each product code.

LEN

Returns the number of characters in a text string.

A screenshot displaying the syntax and explanation of the DAX LEN function used to determine the length of a text string, featuring labeled sections for 'Syntax' and 'Text'.

Example:

LEN Email = LEN(Data[Email])

Outcome:

A Power BI interface showing a table with email addresses and their respective character lengths under 'LEN Email'. The table includes names such as 'rohit.kumar@example.com' and 'sara.lee@example.com'.

LOWER

Converts all letters in a text string to lowercase.

Syntax and description of the DAX LOWER function, which converts text to lowercase.

Example:

 LOWER LastName = LOWER(Data[LastName])

Outcome:

Screenshot showing a table in Power BI displaying LastName and its corresponding LOWER LastName values. The values in the second column are the lowercase versions of the names listed in the first column.

REPLACE

Replaces part of a text string with a different text string.

A diagram illustrating the syntax and parameters of the REPLACE function in DAX, including descriptions for OldText, StartPosition, NumberOfCharacter, and NextText.

Example:

Replace Country = REPLACE(Data[ProductCode], LEN(Data[ProductCode])-1, 2, "XX")

Outcome:

Screenshot of a Power BI interface displaying a table with 'ProductCode' and 'Replace Country' columns, including examples of product codes and their respective country replacements.

REPT

Repeats text a given number of times. Use REPT to fill a cell with a number of instances of a text string.

Syntax and description of the REPT DAX function, detailing its parameters for repeating text.

Example:

Star5 = REPT("*", 5)

Outcome:

Power BI interface showing the 'Star5' visual with asterisks underneath, alongside various tools and options for data manipulation.

RIGHT

Returns the specified number of characters from the end of a text string.

DAX RIGHT function syntax explanation in Power BI, showing parameters Text and NumberOfCharacters.

Example:

RIGHT ProductCode (2) = RIGHT(Data[ProductCode], 2)

Outcome:

Screenshot of Power BI showing a table with ProductCodes and their extracted rightmost values. The left column lists various product codes, and the right column displays the last two characters of each product code.

TRIM

Removes all spaces from a text string except for single space between words.

Syntax for the DAX TRIM function, showing how to remove extra spaces from a text string.

Example:

Full Name (Trimmed) = TRIM( Data[Full Name &] )

Outcome:

A table displayed in Power BI showing two columns: 'Full Name &' and 'Full Name (Trimmed)'. The first column includes names with various cases and spaces, while the second column displays the trimmed versions of those names.

UPPER

Converts a text string to all uppercase letters.

Explanation of the UPPER DAX function syntax and its purpose.

Example:

UPPER City = UPPER(Data[City])

Outcome:

Table displaying two columns: 'City' with names of cities in lowercase and 'UPPER City' with the same names in uppercase letters.

UNICHAR

Returns the Unicode character that is referenced by the given numeric value.

A diagram explaining the syntax and function of the DAX UNICHAR function, detailing how it converts a Unicode number into the corresponding character.

Example:

Snowman = UNICHAR(9731)

Outcome:

Screenshot of Power BI interface showcasing a text box displaying the word 'Snowman' with a snowflake icon.

UNICODE

Returns the number (code point) corresponding to the first character of the text.

Syntax and description of the UNICODE function in DAX, showing its parameters.

Example:

Snowman Code = UNICODE( Data[Snowman] )

Outcome:

Power BI interface displaying 'Snowman Code' with the value '9731' highlighted.

VALUE

Converts a text string that represents a number to a number.

Syntax for the VALUE function in DAX, explaining that it converts text to a numerical value.

Example:
Create a text version of Amount (for the “before” state):

Amount Text = FORMAT( Data[Amount], "0.00" ) // this is TEXT

Convert that text to a number (the “after” state):

Amount From Text = VALUE( [Amount Text] ) // now NUMERIC

Outcome:

Screenshot of Power BI settings showing two fields: 'Amount Fixed' with data type 'Text' and 'Amount From Text' with data type 'Decimal number'.
Screenshot of a Power BI dashboard showing a table with two columns: 'Amount Fixed' and 'Sum of Amount From Text'. The table displays various amounts, including a total of 1,10,125.31 at the bottom. The interface includes visualization tools and data filters on the right side.

Summary

Gaining control over the way your data communicates is possible by mastering DAX’s text functions, which is similar to learning a language’s grammar. You can create reports that are more readable and insightful by learning how to format, reshape, and clean text. These features assist in converting unstructured data into insights that are readable and appear professional, whether that be through the creation of dynamic titles or the design of concise, well-organized labels.

These are some String or Text DAX functions and their descriptions in Power BI. Hope you understand and it will help you. Thanks for reading.

Similar Posts