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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
villa1980
Resolver II
Resolver II

If, Text.trimstart and text.end not working in Formula

Hi all,

 I have the below custom column I would like added, however, I am getting a 'Token ',' expected error showing.

 Any ideas what simple thing I am doing wrong 🙂

 

Text.TrimStart (
Text.Contains([POS PARENT DIVISION NAME],"Area ") then text.end([POS PARENT DIVISION NAME],2)
else "99" )

 

Thanks


Alex

1 ACCEPTED SOLUTION
Cookistador
Super User
Super User

Hi @villa1980 

you forgot the if clause

 

The following code should work 🙂

Text.TrimStart(
    if Text.Contains([POS PARENT DIVISION NAME], "Area ")
    then Text.End([POS PARENT DIVISION NAME], 2)
    else "99"
)

 

View solution in original post

2 REPLIES 2
Cookistador
Super User
Super User

Hi @villa1980 

you forgot the if clause

 

The following code should work 🙂

Text.TrimStart(
    if Text.Contains([POS PARENT DIVISION NAME], "Area ")
    then Text.End([POS PARENT DIVISION NAME], 2)
    else "99"
)

 

That is great tank-you so much for the reply, I knew I was missing something so simple

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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