Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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.

 

2019-07-31 18_25_29-Presentation1 - PowerPoint.png

 

1 ACCEPTED SOLUTION

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.

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

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
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.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks, Xue

 

I tried your formula but didn't work.

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

2019-08-01 12_57_54-Presentation1 - PowerPoint.png

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.

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors