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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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 Kudoed Authors