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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
shamwoo
Frequent Visitor

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 Rows
2 ACCEPTED SOLUTIONS
Chihiro
Solution Sage
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.

View solution in original post

v-frfei-msft
Community Support
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 Rows

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
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 Rows

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @shamwoo,

 

Does that make sense? If so, kindly mark the answer as solution to close the case.


Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Chihiro
Solution Sage
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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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