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

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

Reply
JimT99
Helper I
Helper I

If statement gives error token leftbracket expected

Im getting a token leftBracket expected error:
I'm trying to add a "0" to the end of the field LotTxt if the length of the text is not 10.

Column = IF(LEN(Grading_data[lotTxt]) =10, grading_data[[LotTxt], CONCATENATE(grading_data[LotTxt]),"0")

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @JimT99 ,

 

Could the left bracket error come from here. It seems like there is a double open bracket:

tomfox_0-1651604531738.png

Here your code with the bracket in bold:

Column = IF(LEN(Grading_data[lotTxt]) =10, grading_data[[LotTxt], CONCATENATE(grading_data[LotTxt]),"0")



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

3 REPLIES 3
tackytechtom
Super User
Super User

Hi @JimT99 .

 

Not sure why it says this, but when I pasted your formular into my PBI the CONCATENATE function also had some small issue.

 

Can you try it with the following syntax?
Column = IF(LEN(Grading_data[lotTxt]) =10, grading_data[LotTxt], CONCATENATE(grading_data[LotTxt],"0"))

 
Let me know if this helps and do not forget to mark the answer 🙂
 


Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

tackytechtom
Super User
Super User

Hi @JimT99 ,

 

Could the left bracket error come from here. It seems like there is a double open bracket:

tomfox_0-1651604531738.png

Here your code with the bracket in bold:

Column = IF(LEN(Grading_data[lotTxt]) =10, grading_data[[LotTxt], CONCATENATE(grading_data[LotTxt]),"0")



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

yes...that was it. (Embarassed).  Now it tells me that "If" isn't recognized.

Expression.Error: The name 'If' wasn't recognized. Make sure it's spelled correctly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.