Forum Discussion
Limited Records Imported Based on Date
Hi All,
I've found some code to pull 3-years worth of data dynamically. It is giving me a 'Token Comma expected' error on #"Filtered Rows" however. Would you please provide any thoughts or suggestions on how to troubleshoot the following code? Thank you in advance!
let
Source = Salesforce.Data(),
#"Year" = Date.Year(DateTime.LocalNow())-3,
Opportunity1 = Source{[Name="Opportunity"]}[Data]
#"Filtered Rows" = Table.SelectRows(Opportunity1, each Date.Year([LastModifiedDate]) >= #"Year")
in
#"Filtered RowsIn "M" you need "," at end of each line between 'let' & 'in' except at last line before 'in'. (Excluding line continuation)
Looks like you are missing "," at Opportunity1 line.
Hi shamwoo,
Please update your code as below and try again.
let Source = Salesforce.Data(), #"Year" = Date.Year(DateTime.LocalNow())-3, Opportunity1 = Source{[Name="Opportunity"]}[Data], #"Filtered Rows" = Table.SelectRows(Opportunity1, each Date.Year([LastModifiedDate]) >= #"Year") in #"Filtered RowsRegards,
Frank
3 Replies
- Chihiro
Solution Sage
In "M" you need "," at end of each line between 'let' & 'in' except at last line before 'in'. (Excluding line continuation)
Looks like you are missing "," at Opportunity1 line.
- v-frfei-msft
Community Support
Hi shamwoo,
Please update your code as below and try again.
let Source = Salesforce.Data(), #"Year" = Date.Year(DateTime.LocalNow())-3, Opportunity1 = Source{[Name="Opportunity"]}[Data], #"Filtered Rows" = Table.SelectRows(Opportunity1, each Date.Year([LastModifiedDate]) >= #"Year") in #"Filtered RowsRegards,
Frank
- v-frfei-msft
Community Support
Hi shamwoo,
Does that make sense? If so, kindly mark the answer as solution to close the case.
Regards,
Frank