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
phmoberg
Frequent Visitor

Token Equal expected

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.. 

 

phmoberg_0-1664963561612.png

 

//
#"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"

 

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

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

View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @phmoberg ,

 

What was the issue in the end? Was it the missing quotation marks?

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




HotChilli
Super User
Super User

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




BA_Pete
Super User
Super User

Hi @phmoberg ,

 

It looks to me like you're missing the closing speech mark on your step name:

BA_Pete_0-1664970628708.png

 

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"

BA_Pete_0-1664972871207.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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.

Top Solution Authors
Top Kudoed Authors