Home » DAX » DAX – LEN Function

DAX – LEN Function

LEN DAX Functions

Power BI DAX LEN function returns the length of a given string. It comes under Text DAX functions category.

Syntax:

LEN(string)

Description:

S no. Parameter Description
1 Text The text whose length you want to find. Spaces count as characters.




Let’s start with an example:

Step-1: Sample Dataset as below:

Sample Dataset for DAX String Functions

Sample Dataset for DAX String Functions





Step-2: Create a New column, right click on Dataset & click on New column.

Step-3: Now, to determine the length of a character string in the “Product Sub Category” name column, you can use the following DAX expression:

Len_Dax = LEN(Orders[Product Sub-Category])

Step-4: Add a new column to the Table visual, then right-click on the newly added column within the “Values” section. Select “Don’t Summarize” from the context menu.

Len Example

Len Example





Step-5: Output as below

LEN Function Example

LEN Function Example

Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.

Recommended DAX Post:

LEFT

LOWER

UPPER

ALLEXCEPT

UNION

DATATABLE

ALLSELECTED

ALL ADDCOLUMNS

CONCATENATE

CONCATENATEX



Leave a Reply