Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

MID function with a dynamic start point

Hi

Im trying to run a MID where starting points depends on every row, that's why is link to column instead of having a fixed value. But for some reason, I get an error. You know how can I make it work?

 

B = mid('Campaign (1)'[Labels on Campaign], 'Campaign (1)'[A], 10)
 
'Campaign (1)'[A] is where I calculate the start point of each row.

 

 

  • Hi Anonymous ,

    I'm apologize that this formula lacks a ")". Please try the formula again.

    Column =
    IF (
        ISERROR ( MID ( 'Campaign (1)'[Labels on Campaign], 'Campaign (1)'[A], 10 ) ),
        BLANK (),
        MID ( 'Campaign (1)'[Labels on Campaign], 'Campaign (1)'[A], 10 )
    )

    Best Regards,

    Xue

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • v-xuding-msft's avatar
    v-xuding-msft
    Community Support

    Hi Anonymous ,

    Please check if there is null and zero in the column of A. The positions start at 1. So null values and zero are not supported. This is the document of MID you can reference.

    Column = IF(ISERROR(MID('Campaign (1)'[Labels on Campaign], 'Campaign (1)'[A], 10),BLANK(),MID('Campaign (1)'[Labels on Campaign], 'Campaign (1)'[A], 10))

    Best Regards,

    Xue

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, Xue

       

      I tried your formula but didn't work.

      I've checked and column A has some blank cells.

      • v-xuding-msft's avatar
        v-xuding-msft
        Community Support

        Hi Anonymous ,

        I'm apologize that this formula lacks a ")". Please try the formula again.

        Column =
        IF (
            ISERROR ( MID ( 'Campaign (1)'[Labels on Campaign], 'Campaign (1)'[A], 10 ) ),
            BLANK (),
            MID ( 'Campaign (1)'[Labels on Campaign], 'Campaign (1)'[A], 10 )
        )

        Best Regards,

        Xue

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.