Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 10 | |
| 6 | |
| 5 | |
| 5 | |
| 2 |