The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi guys.. Thank you in advance for your help..
I got this Error " Token Equal expected " and can't figure out how to fix it..
//
#"Expanded Attributes" = Table.ExpandRecordColumn(#"Expanded Custom.Data", "Custom.Data.Attributes", {"AppointmentType", "Duration", "ExtendedProperties", "LastOccurrence", "Organizer", "Recurrence"}, {"Attributes.AppointmentType", "Duration", "ExtendedProperties", "LastOccurrence", "Organizer", "Attributes.Recurrence"}),
#"Filtered Rows3" = Table.SelectRows(#"Expanded Attributes", each ([Attributes.AppointmentType] = "RecurringMaster")),
#"Replaced Value" = Table.ReplaceValue(#"Filtered Rows3",null,"meeting",Replacer.ReplaceValue,{"Location"}),
#"Added Conditional Column1" = Table.AddColumn(#"Replaced Value", "Office", each if Text.Contains([Location], "meeting") then "XXXXcity" else "XXXXcity"),
#"Added Conditional Column2" = Table.AddColumn(#"Added Conditional Column1", "Room", each if Text.Contains([Location], "meeting") then "XXXXXmeeting room name" else "XXXXXmeeting room name"),
#"Expanded Recurrence" = Table.ExpandRecordColumn(#"Added Conditional Column2", "Recurrence", {"StartDate", "EndDate", "NumberOfOccurrences", "Pattern", "Interval", "DayOfMonth", "DayOfTheWeek", "DaysOfTheWeek"}, {"Recurrence.StartDate", "Recurrence.EndDate", "Recurrence.NumberOfOccurrences", "Recurrence.Pattern", "Recurrence.Interval", "Recurrence.DayOfMonth", "Recurrence.DayOfTheWeek", "Recurrence.DaysOfTheWeek"}),
#"Expanded ExtendedProperties" = Table.ExpandRecordColumn(#"Expanded Recurrence", "ExtendedProperties", {"RecurrencePattern"}, {"ExtendedProperties.RecurrencePattern"}),
#"Expanded LastOccurrence" = Table.ExpandRecordColumn(#"Expanded ExtendedProperties", "LastOccurrence", {"End"}, {"LastOccurrence.End"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded LastOccurrence",{{"LastOccurrence.End", type date}, {"Recurrence.StartDate", type date}, {"Recurrence.EndDate", type date}}),
#"Added Custom2" = Table.AddColumn(#"Added Custom6 = Table.AddColumn(#", "Newrecurrenceinterval", each if [Recurrence.Pattern] = "RelativeMonthlyPattern" then [Recurrence.Interval]*4 else [Recurrence.Interval]),
#"Expanded DatesInPeriod" = Table.ExpandListColumn(#"Added Custom2", "DatesInPeriod"),
#"Filtered Rows6" = Table.SelectRows(#"Expanded DatesInPeriod", each true),
#"Added Custom6 = Table.AddColumn(#"Changed Type", "DatesInPeriod", each List.Dates([Recurrence.StartDate],Duration.Days(Duration.From([LastOccurrence.End]-[Recurrence.StartDate])),#duration(1,0,0,0))),
#"Added Custom1" = Table.AddColumn(#"Filtered Rows6", "DateDiffModInterval", each Number.Mod(Duration.Days(Duration.From([DatesInPeriod]-[Recurrence.StartDate])),7*[Newrecurrenceinterval])),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"DatesInPeriod", type date}}),
#"Duplicated Column" = Table.DuplicateColumn(#"Changed Type1", "DatesInPeriod", "DatesInPeriod - Copy"),
#"Extracted Day Name" = Table.TransformColumns(#"Duplicated Column", {{"DatesInPeriod - Copy", each Date.DayOfWeekName(_), type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Extracted Day Name",{{"DatesInPeriod - Copy", "DayName"}}),
#"Replaced Value1" = Table.ReplaceValue(#"Renamed Columns",null,0,Replacer.ReplaceValue,{"Newrecurrenceinterval"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1",null,0,Replacer.ReplaceValue,{"DateDiffModInterval"}),
#"Filtered Rows4" = Table.SelectRows(#"Replaced Value2", each [DateDiffModInterval] = 0),
#"Filtered Rows5" = Table.SelectRows(#"Filtered Rows4", each true),
#"Expanded Organizer" = Table.ExpandRecordColumn(#"Filtered Rows5", "Organizer", {"Name"}, {"Name"}),
#"Expanded Body" = Table.ExpandRecordColumn(#"Expanded Organizer", "Body", {"TextBody"}, {"TextBody"})
in
#"Expanded Body"
Solved! Go to Solution.
There are a few things going on : missing " characters , referring to steps which don't exist yet. I suggest keeping a copy of the code somewhere safe and then deleting later steps until the syntax errors go then reintroduce your steps and debug
Hi @phmoberg ,
What was the issue in the end? Was it the missing quotation marks?
Pete
Proud to be a Datanaut!
There are a few things going on : missing " characters , referring to steps which don't exist yet. I suggest keeping a copy of the code somewhere safe and then deleting later steps until the syntax errors go then reintroduce your steps and debug
Hi @HotChilli ,
The "referring to steps which don't exist yet" won't matter as M isn't parsed top to bottom.
To read OP's code as a human, one would logically expect #Added Custom6" to come between #"Changed Type" and #"Added Custom2", but the handler doesn't care, it will just line the code up in Source>previousStepName>stepName>previousStepName order (if that makes sense?) so, as long as each step is correctly referenced to a previous one, it doesn't matter in what order they appear in the code window.
Pete
Proud to be a Datanaut!
Hi @phmoberg ,
It looks to me like you're missing the closing speech mark on your step name:
You can tell when you're missing a speech mark somewhere as all the text/non-text Intellisense colours become inverted after the error.
You'll also need to correct this in the step reference of #"Added Custom2"
Pete
Proud to be a Datanaut!