Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
Solved! Go to Solution.
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
Hi everyone,
I have the same issue but actually don't understand what's wrong with my code. I get the error message: missing identifier". Hope someone can help. The code is:
let
//Find the current date and time when this query runs
CurrentDateTime = DateTimeZone.FixedUtcNow(),
//Find yesterday's date
PreviousDay = Date.AddDays(DateTime.Date(CurrentDateTime),–1),
//Put the current date and time in a new column in the table
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "UTC", each CurrentDateTime),
#"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"UTC", type datetimezone}}),
//Add the filter required for incremental refresh
//Only return rows in this table if:
//a) The RangeStart parameter equals yesterday's date, and
//b) RangeEnd is not null (which should never be true)
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each DateTime.Date(RangeStart)=PreviousDay and RangeEnd<>null)
in
#"Filtered Rows"
"–1" is the problem. This is "en dash" 1 not "minus one". Retype the minus.
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]
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
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
if [(ref).v_cust_po_date] = null
then [(ref).so_header_create_date]
else [(ref).v_cust_po_date]),
⚠️ Invalid identifier.
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 you for this. Had the same issue with a field [Total Price Ex Tax ($)] and your solution solved this 🙂
Thank God for you is all I can say.
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
Hi Xiaoxin,
That's what I ended up doing. Thanks for your answer!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |