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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
dids86
Regular Visitor

Removing Characters from text string with DAX

Hi,

 

I'm trying to remove the last 10 characters from a text string using the below formula

 

Column = LEFT('Table1'[Text],LEN('Table1'[Text])-10)
 
I'm getting the below error message
 
An argument of function 'LEFT' has the wrong data type or has an invalid value.
 
I think this because there are some blank rows within the table column identified. Is there any way I can amend the above formula with an IFERROR to resolve the issue? 
1 ACCEPTED SOLUTION
MasonMA
Super User
Super User

Hi, would amending the measure this way fix the issue? It returns a blank if the formula encounters an error, e.g., due to a null or short string.

 

Column =
IFERROR(
    LEFT('Table'[Text], LEN('Table'[Text]) - 10),
    BLANK()
)

View solution in original post

2 REPLIES 2
dids86
Regular Visitor

Thanks MasonMA!

MasonMA
Super User
Super User

Hi, would amending the measure this way fix the issue? It returns a blank if the formula encounters an error, e.g., due to a null or short string.

 

Column =
IFERROR(
    LEFT('Table'[Text], LEN('Table'[Text]) - 10),
    BLANK()
)

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors