Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Any help is appreciated. The Token Literal Expected error message is underlining the "in" line.
Hi @Anonymous
Try replacing the last M codes with below codes. You need to give a name to the last step. Here I name it as #"Filtered Rows 2", you can use any name which hasn't been used in previous steps. And no comma at the end of the last step. Also put the name of last step after "in", then it will return the result of the last step.
#"Removed Duplicates" = Table.Distinct(#"Clear null",{"DATE"}),
#"Filtered Rows 2" = Table.SelectRows(#"Removed Duplicates", each [DATE] >= List.Min(#"Removed Duplicates"[DATE]) and [DATE] <= Date.AddYears(List.Min(#"Removed Duplicates"[DATE]),5))
in
#"Filtered Rows 2"
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Agreed, you need to remove the comma before "in", but you also need to name your last Table.SelectRows statement, like ThisStep = Table.SelectRows(etc.)
in
ThisStep
--Nate
Hey @Anonymous
Looks like your last line of code before the in statement has a comma at the end. Remove the comma. Also, the entire last statement.
Not sure if it'll work that way you may need to change the comma you have seperating the two functions with an and like this:
#"Removed Duplicates" =
Table.Distinct(#"Clear null",{"DATE"}) and
Table.SelectRows(#"Filtered Rows", each [DATE] >= List.Min(#"Filtered Rows"[DATE]) and [DATE]<= Date.AddYears(List.Min(#"Filtered Rows"[DATE], 5)))
in
#"Removed Duplicates"
Proud to be a Super User!
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 5 | |
| 4 | |
| 3 |