DAX Text - MID function



Description

Returns a string of characters from the middle of a text string, given a starting position and length.

Syntax

MID (<text>, <start_num>, <num_chars>) 

Parameters

Sr.No. Parameter & Description
1

text

The text string from which you want to extract the characters, or a column that contains text.

2

start_num

A whole number representing the position of the first character you want to extract. The numbers start from 1 at the beginning of the text.

3

num_chars

The number of characters to return.

Return Value

A text string.

Remarks

DAX uses Unicode and stores all characters with the same length.

Example

= MID ([Product], 1, 5), and 
= LEFT ([Product], 5) return the same characters. 

However, you can use DAX MID function to extract text from the middle of the input string.

= MID ([Product],5,5) returns 5 characters starting from the 5th character. 
dax_functions_text.htm
Advertisements