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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NAOS
Helper IV
Helper IV

power query expression.syntax error invalid identifier with parentheses

Hi all, I'm trying to reference a column in a query step as follows:

ModifySiteArea = Table.ReplaceValue(RenameColumns,each [Site Area (m2)], each if [UnitOfMeasurement] = "ft²"  then Value.Divide([Site Area (m2)],10.764) else [Site Area (m2)],Replacer.ReplaceValue,{"Site Area (m2)"})

This causes the Expression.Syntax error. Invalid Indetifier to show up. If I rename the column "Site Area (m2)" to "Site Area" the query works with no problems. The double quotes on the column name don't solve the problem either.   Could someone explain me why is this?  

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @NAOS,

 

Actually, current you can't use specific characters in [] operator. Maybe you can consider to change name before do this operation and restore fields name after finished replace operations.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

7 REPLIES 7
vernc
Frequent Visitor

wow, this is critical, I had an unresolvable issue with the invalid syntax identifier present within [ID: Item Cat] and I had tried with putting ["ID: Item Cat"] or changing it to {ID: Item Cat} but that would mean that we don't consider the headers but values themselves and then after it worked when I replaced the syntax with just this [Item Cat]

Rudz
Kudo Collector
Kudo Collector

I had a similar problem with a column with a question mark in the column name. Here's the syntax that worked there. I'm guessing it would work for yours too.

 

[#"Valid?"]

 

worked like a charm

Anonymous
Not applicable

Thanks @Rudz, this worked for me!

I was getting the error due to my column names beginning with "(ref)." and this saved me from having to add multiple unnecessary steps

 

 

Before:

 

 

		if [(ref).v_cust_po_date] = null
		then [(ref).so_header_create_date]
		else [(ref).v_cust_po_date]),

 

 

⚠️ Invalid identifier.

--

After:

 

 

		if [#"(ref).v_cust_po_date"] = null
		then [#"(ref).so_header_create_date"]
		else [#"(ref).v_cust_po_date"]),

 

 

✔️ No syntax errors have been detected.

 

Thank God for you is all I can say.

v-shex-msft
Community Support
Community Support

HI @NAOS,

 

Actually, current you can't use specific characters in [] operator. Maybe you can consider to change name before do this operation and restore fields name after finished replace operations.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi Xiaoxin,

That's what I ended up doing. Thanks for your answer!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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