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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
TPGDIMO
New Member

Token Eof expected error

i wrote simple nested if statement in power query  editor.

 

it gives Token Eof expected error in highlighted possition. What is the reason

 

IF [Date.last.editted] > "01/04/2022" then "2022/2023"

else
IF [Date.last.editted] > "01/04/2021" then "2021/2022"
else
IF [Date.last.editted] > "01/04/2020" then "2020/2021"
else
IF [Date.last.editted] > "01/04/2019" then "2019/2020"
else
IF [Date.last.editted] > "01/04/2018" then "2018/2019"
else "2017/2018"

1 ACCEPTED SOLUTION
m13eam
Resolver III
Resolver III

Hi - M/PowerQuery is case-sensitive, so it doesn't recognise "IF". Hopefully the below should work

 

if [Date.last.editted] > "01/04/2022" then "2022/2023"

else
if [Date.last.editted] > "01/04/2021" then "2021/2022"
else
if [Date.last.editted] > "01/04/2020" then "2020/2021"
else
if [Date.last.editted] > "01/04/2019" then "2019/2020"
else
if [Date.last.editted] > "01/04/2018" then "2018/2019"
else "2017/2018"

 

I hope that helps!

View solution in original post

1 REPLY 1
m13eam
Resolver III
Resolver III

Hi - M/PowerQuery is case-sensitive, so it doesn't recognise "IF". Hopefully the below should work

 

if [Date.last.editted] > "01/04/2022" then "2022/2023"

else
if [Date.last.editted] > "01/04/2021" then "2021/2022"
else
if [Date.last.editted] > "01/04/2020" then "2020/2021"
else
if [Date.last.editted] > "01/04/2019" then "2019/2020"
else
if [Date.last.editted] > "01/04/2018" then "2018/2019"
else "2017/2018"

 

I hope that helps!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors