DAX Function Guide

MID
Empty image or helper icon

Sam McKay

CEO & Founder

How does the MID work?
MID function returns a string of characters, given the starting position and length, from the middle of a text string.
MID Formula Syntax

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

How do you use the MID?

A text string with the specified length.

Related Blog Posts

Loading

Considerations when using the MID?

Whereas Microsoft Excel has various functions for dealing with languages of single byte and double byte characters, DAX uses Unicode and stores all characters of the same length.

Related Video Tutorials

Loading

Formula examples using the MID

The following examples return the same results, the first 5 letters of the column, [ResellerName]. The first example uses the fully qualified name of the column and specifies the starting point; the second example omits the table name and the parameter, num_chars.

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

= MID (
    [ResellerName,5]
)

The results are the same if you use the following formula:

= LEFT (
    [ResellerName],5
)

Related Courses

Loading