MID

Updated on

MID is a DAX function that returns a specified number of characters from the middle of a text string, starting at a given position.

Syntax

MID(
   Text,
   StartPosition,
   NumberOfCharacters
)
Argument Properties Description
Text The text string from which you want to extract the characters.
StartPosition The position of the first character you want to extract. Positions start at 1.
NumberOfCharacters The number of characters to return.

Return Values

A string of text of the specified length.

Remarks

Whereas Microsoft Excel has different functions for working with single-byte and double-byte characters languages, DAX uses Unicode and stores all characters with the same length.

Examples

The following expression,

MID("abcde",2,3))

Returns "bcd".

The following expression,

MID('Reseller'[ResellerName],1,5))

Returns the same result as LEFT([ResellerName],5). Both expressions return the first 5 letters of column, [ResellerName].

Other functions related to MID are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/mid-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy